From 61a0a7157dd080a9d251b621b85c83052161c8ff Mon Sep 17 00:00:00 2001 From: Snehal Sakhardande <46550209+snehals-uc@users.noreply.github.com> Date: Mon, 9 Sep 2024 11:12:49 +0530 Subject: [PATCH] Release 1.1.0 (#20) * Update test_usage_api.py (#9) * Updated test_get_billing_usage_by_billing_cycle to fetch billing cycle date from test_get_billing_cycles (#10) * Removed log function from test base * Updated test_get_billing_usage_by_billing_cycle to fetch billing cycle from test_get_billing_cycles * Merging changes to testing test workflows (#12) * Update test_usage_api.py * Sync dev with main (#11) * Update test_usage_api.py (#9) * Updated test_get_billing_usage_by_billing_cycle to fetch billing cycle date from test_get_billing_cycles (#10) * Removed log function from test base * Updated test_get_billing_usage_by_billing_cycle to fetch billing cycle from test_get_billing_cycles --------- Co-authored-by: santhosh-uc * Update test_party_analytics_api.py --------- Co-authored-by: santhosh-uc * New SDK changes (#13) * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge (#14) * Change to run test * Change to run test (#15) * Adding statement to echo secrets * Update run_sdk_test.yml * Update run_sdk_test.yml * Updated test workflow * Adding statement to echo secrets in GitHub action workflow (#16) * Change to run test * Adding statement to echo secrets * Update run_sdk_test.yml * Update run_sdk_test.yml * Updated test workflow * Dev to master (#18) * Update test_usage_api.py * Sync dev with main (#11) * Update test_usage_api.py (#9) * Updated test_get_billing_usage_by_billing_cycle to fetch billing cycle date from test_get_billing_cycles (#10) * Removed log function from test base * Updated test_get_billing_usage_by_billing_cycle to fetch billing cycle from test_get_billing_cycles --------- Co-authored-by: santhosh-uc * Update test_party_analytics_api.py * New SDK changes (#17) * Update test_usage_api.py (#9) * Updated test_get_billing_usage_by_billing_cycle to fetch billing cycle date from test_get_billing_cycles (#10) * Removed log function from test base * Updated test_get_billing_usage_by_billing_cycle to fetch billing cycle from test_get_billing_cycles * Merging changes to testing test workflows (#12) * Update test_usage_api.py * Sync dev with main (#11) * Update test_usage_api.py (#9) * Updated test_get_billing_usage_by_billing_cycle to fetch billing cycle date from test_get_billing_cycles (#10) * Removed log function from test base * Updated test_get_billing_usage_by_billing_cycle to fetch billing cycle from test_get_billing_cycles --------- Co-authored-by: santhosh-uc * Update test_party_analytics_api.py --------- Co-authored-by: santhosh-uc * New SDK changes (#13) * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge * Initial merge (#14) * Change to run test * Change to run test (#15) * Adding statement to echo secrets * Update run_sdk_test.yml * Update run_sdk_test.yml * Updated test workflow * Adding statement to echo secrets in GitHub action workflow (#16) * Change to run test * Adding statement to echo secrets * Update run_sdk_test.yml * Update run_sdk_test.yml * Updated test workflow * Initial merge --------- Co-authored-by: pshenoy-uc <1192820+pshenoy-uc@users.noreply.github.com> Co-authored-by: santhosh-uc --------- Co-authored-by: santhosh-uc Co-authored-by: Snehal Sakhardande <46550209+snehals-uc@users.noreply.github.com> * Initial merge * Initial merge --------- Co-authored-by: pshenoy-uc <1192820+pshenoy-uc@users.noreply.github.com> Co-authored-by: santhosh-uc --- CHANGELOG.rst | 7 + README.md | 31 +- pyproject.toml | 71 + requirements.txt | 4 +- setup.py | 38 +- test/README.md | 2 +- test/base.py | 6 +- test/test_attorney_analytics_api.py | 1 - test/test_authentication_api.py | 1 - test/test_case_analytics_api.py | 1 - test/test_case_docket_api.py | 28 +- test/test_case_document_api.py | 45 +- test/test_case_tracking_api.py | 22 - test/test_case_update_api.py | 27 +- test/test_court_availability_api.py | 11 +- test/test_court_standards_api.py | 75 +- test/test_law_firm_analytics_api.py | 8 - test/test_pacer_api.py | 13 +- test/test_party_analytics_api.py | 1 - test/test_usage_api.py | 2 +- unicourt/__init__.py | 294 +- unicourt/api/__init__.py | 25 +- unicourt/api/attorney_analytics_api.py | 2623 +- unicourt/api/authentication_api.py | 1617 +- unicourt/api/callback_api.py | 457 +- unicourt/api/case_analytics_api.py | 8179 +++-- unicourt/api/case_docket_api.py | 6383 ++-- unicourt/api/case_documents_api.py | 2700 +- unicourt/api/case_export_api.py | 1246 +- unicourt/api/case_search_api.py | 927 +- unicourt/api/case_tracking_api.py | 1686 +- unicourt/api/case_update_api.py | 1278 +- unicourt/api/court_availability_api.py | 417 +- unicourt/api/court_standards_api.py | 25498 ++++++++++------ unicourt/api/judge_analytics_api.py | 2623 +- unicourt/api/law_firm_analytics_api.py | 2623 +- unicourt/api/pacer_api.py | 12717 +++++--- unicourt/api/pacer_credential_api.py | 1611 +- unicourt/api/party_analytics_api.py | 2623 +- unicourt/api/usage_api.py | 1141 +- unicourt/api_client.py | 1215 +- unicourt/api_response.py | 21 + unicourt/configuration.py | 134 +- unicourt/constants.py | 1 + unicourt/exceptions.py | 170 +- unicourt/model/__init__.py | 284 +- .../model/access_token_id_list_response.py | 339 +- unicourt/model/access_token_id_response.py | 354 +- unicourt/model/access_token_request.py | 321 +- unicourt/model/access_token_response.py | 353 +- unicourt/model/additional_levels.py | 387 +- unicourt/model/address.py | 537 +- unicourt/model/area_of_law.py | 378 +- unicourt/model/area_of_law_response.py | 411 +- unicourt/model/associated_norm_attorney.py | 449 +- .../associated_norm_attorney_response.py | 377 +- unicourt/model/associated_norm_judge.py | 442 +- .../model/associated_norm_judge_response.py | 377 +- unicourt/model/associated_norm_law_firm.py | 411 +- .../associated_norm_law_firm_response.py | 377 +- unicourt/model/associated_norm_party.py | 411 +- .../model/associated_norm_party_response.py | 377 +- unicourt/model/associated_so_s_person.py | 375 +- unicourt/model/attorney.py | 610 +- unicourt/model/attorney_analytics_api.py | 409 +- unicourt/model/attorney_law_firm.py | 376 +- .../model/attorney_representation_type.py | 354 +- .../attorney_representation_type_response.py | 411 +- unicourt/model/attorney_type.py | 354 +- unicourt/model/attorney_type_response.py | 411 +- unicourt/model/attorneys.py | 384 +- unicourt/model/bar_record.py | 489 +- unicourt/model/bar_record_preview.py | 361 +- unicourt/model/bar_source_data.py | 1382 +- ...data_administrative_actions_array_inner.py | 386 +- ...source_data_advanced_degree_array_inner.py | 331 +- .../bar_source_data_bar_status_array_inner.py | 331 +- ...e_data_board_certifications_array_inner.py | 331 +- .../bar_source_data_committees_array_inner.py | 347 +- ...r_source_data_court_history_array_inner.py | 370 +- .../bar_source_data_court_of_admissions.py | 321 +- ...e_data_disciplinary_history_array_inner.py | 647 +- ...e_data_discipline_summaries_array_inner.py | 348 +- ...rce_data_employment_history_array_inner.py | 348 +- ...ar_source_data_fees_options_array_inner.py | 385 +- ...ar_source_data_involvements_array_inner.py | 347 +- .../bar_source_data_law_school_array_inner.py | 332 +- unicourt/model/bar_source_data_name.py | 386 +- ...rce_data_open_action_status_array_inner.py | 332 +- ...rce_data_other_jurisdiction_array_inner.py | 331 +- ..._source_data_public_hearing_array_inner.py | 386 +- ...bar_source_data_reason_for_inactivation.py | 331 +- ...r_source_data_related_cases_array_inner.py | 332 +- unicourt/model/bar_source_data_source_info.py | 311 +- ...grievance_committee_history_array_inner.py | 370 +- ..._source_data_status_history_array_inner.py | 332 +- ...ce_data_ten_year_discipline_array_inner.py | 348 +- .../model/billing_cycle_usage_response.py | 411 +- ...cycle_usage_response_api_calls_billable.py | 320 +- ...cycle_usage_response_api_calls_credited.py | 320 +- ...ing_cycle_usage_response_api_calls_made.py | 320 +- ...ling_cycle_usage_response_billing_cycle.py | 321 +- unicourt/model/billing_cycles_response.py | 323 +- unicourt/model/callback_list_response.py | 344 +- ..._response_case_document_order_callbacks.py | 317 +- ...ack_list_response_case_export_callbacks.py | 279 - unicourt/model/case.py | 760 +- unicourt/model/case_analytics_api.py | 461 +- unicourt/model/case_cause_of_action.py | 349 +- unicourt/model/case_charge.py | 387 +- unicourt/model/case_class.py | 354 +- unicourt/model/case_class_coverage.py | 417 +- unicourt/model/case_class_response.py | 411 +- .../case_count_analytics_by_area_of_law.py | 355 +- ...count_analytics_by_area_of_law_response.py | 400 +- .../case_count_analytics_by_case_class.py | 355 +- ..._count_analytics_by_case_class_response.py | 400 +- ...case_count_analytics_by_case_filed_date.py | 493 +- ...t_analytics_by_case_filed_date_response.py | 400 +- .../case_count_analytics_by_case_type.py | 355 +- ...case_count_analytics_by_case_type_group.py | 355 +- ...t_analytics_by_case_type_group_response.py | 400 +- ...e_count_analytics_by_case_type_response.py | 400 +- .../model/case_count_analytics_by_court.py | 369 +- .../case_count_analytics_by_court_geo.py | 331 +- .../case_count_analytics_by_court_location.py | 387 +- ...nt_analytics_by_court_location_response.py | 400 +- .../case_count_analytics_by_court_response.py | 400 +- .../case_count_analytics_by_court_system.py | 369 +- ...ount_analytics_by_court_system_response.py | 400 +- .../case_count_analytics_by_court_type.py | 369 +- ..._count_analytics_by_court_type_response.py | 400 +- ...ase_count_analytics_by_jurisdiction_geo.py | 369 +- ..._analytics_by_jurisdiction_geo_response.py | 400 +- .../case_count_analytics_by_norm_attorney.py | 361 +- ...unt_analytics_by_norm_attorney_response.py | 400 +- .../case_count_analytics_by_norm_judge.py | 358 +- ..._count_analytics_by_norm_judge_response.py | 400 +- .../case_count_analytics_by_norm_law_firm.py | 361 +- ...unt_analytics_by_norm_law_firm_response.py | 400 +- .../case_count_analytics_by_norm_party.py | 361 +- ..._count_analytics_by_norm_party_response.py | 400 +- .../case_count_analytics_by_party_role.py | 355 +- ...ase_count_analytics_by_party_role_group.py | 355 +- ..._analytics_by_party_role_group_response.py | 400 +- ..._count_analytics_by_party_role_response.py | 400 +- unicourt/model/case_document.py | 588 +- .../model/case_document_order_callback.py | 455 +- ...e_document_order_callback_list_response.py | 407 +- .../case_document_order_pacer_options.py | 338 +- unicourt/model/case_document_order_request.py | 335 +- unicourt/model/case_documents.py | 384 +- unicourt/model/case_export_callback.py | 440 +- .../case_export_callback_list_response.py | 407 +- unicourt/model/case_relationship_type.py | 354 +- .../model/case_relationship_type_response.py | 411 +- unicourt/model/case_search_response.py | 435 +- unicourt/model/case_search_result.py | 523 +- unicourt/model/case_stats.py | 401 +- unicourt/model/case_status.py | 393 +- unicourt/model/case_status_group.py | 354 +- unicourt/model/case_status_group_response.py | 411 +- unicourt/model/case_status_response.py | 411 +- unicourt/model/case_timeline.py | 333 +- unicourt/model/case_track.py | 446 +- unicourt/model/case_track_list_response.py | 407 +- unicourt/model/case_track_preview.py | 432 +- unicourt/model/case_track_request.py | 330 +- unicourt/model/case_track_schedule.py | 335 +- unicourt/model/case_type.py | 491 +- unicourt/model/case_type_group.py | 406 +- unicourt/model/case_type_group_response.py | 411 +- unicourt/model/case_type_response.py | 411 +- unicourt/model/case_update.py | 438 +- unicourt/model/case_update_list_response.py | 407 +- unicourt/model/case_update_pacer_options.py | 402 +- ...cer_options_additional_page_array_inner.py | 334 +- .../case_update_pacer_options_response.py | 428 +- unicourt/model/case_update_preview.py | 424 +- unicourt/model/case_update_request.py | 327 +- unicourt/model/cause_of_action.py | 378 +- .../model/cause_of_action_additional_data.py | 366 +- ...ause_of_action_additional_data_response.py | 411 +- unicourt/model/cause_of_action_group.py | 354 +- .../model/cause_of_action_group_response.py | 411 +- unicourt/model/cause_of_action_response.py | 411 +- unicourt/model/charge.py | 378 +- unicourt/model/charge_additional_data.py | 366 +- .../model/charge_additional_data_response.py | 411 +- unicourt/model/charge_degree.py | 354 +- unicourt/model/charge_degree_response.py | 411 +- unicourt/model/charge_group.py | 354 +- unicourt/model/charge_group_response.py | 411 +- unicourt/model/charge_response.py | 411 +- unicourt/model/charge_severity.py | 354 +- unicourt/model/charge_severity_response.py | 411 +- unicourt/model/contact.py | 381 +- unicourt/model/court.py | 540 +- unicourt/model/court_coverage.py | 435 +- unicourt/model/court_location.py | 452 +- unicourt/model/court_location_response.py | 411 +- unicourt/model/court_response.py | 411 +- unicourt/model/court_service_status.py | 416 +- .../model/court_service_status_response.py | 411 +- unicourt/model/court_system.py | 378 +- unicourt/model/court_system_response.py | 411 +- unicourt/model/court_type.py | 354 +- unicourt/model/court_type_response.py | 411 +- unicourt/model/daily_usage_response.py | 406 +- unicourt/model/docket_entries.py | 384 +- unicourt/model/docket_entry.py | 513 +- .../model/docket_entry_primary_documents.py | 384 +- .../model/docket_entry_secondary_documents.py | 384 +- unicourt/model/document_download.py | 400 +- unicourt/model/email.py | 362 +- unicourt/model/exception.py | 353 +- unicourt/model/export_file.py | 354 +- unicourt/model/extracted_fields.py | 316 +- unicourt/model/hearing.py | 410 +- unicourt/model/hearings.py | 381 +- unicourt/model/individual.py | 369 +- .../model/invalidate_access_token_request.py | 333 +- unicourt/model/judge.py | 525 +- unicourt/model/judge_analytics_api.py | 360 +- unicourt/model/judge_type.py | 354 +- unicourt/model/judge_type_response.py | 411 +- unicourt/model/judges.py | 384 +- unicourt/model/jurisdiction_geo.py | 438 +- unicourt/model/jurisdiction_geo_response.py | 411 +- unicourt/model/last_tracked_details.py | 373 +- unicourt/model/law_firm_analytics_api.py | 409 +- unicourt/model/matched_object.py | 377 +- unicourt/model/nature_of_suit.py | 375 +- unicourt/model/norm_attorney.py | 474 +- .../model/norm_attorney_search_response.py | 435 +- unicourt/model/norm_attorney_search_result.py | 414 +- unicourt/model/norm_corporate_group.py | 345 +- unicourt/model/norm_judge.py | 456 +- unicourt/model/norm_judge_public_data.py | 523 +- .../norm_judge_public_data_aba_ratings.py | 328 +- unicourt/model/norm_judge_public_data_bio.py | 438 +- ...judge_public_data_education_array_inner.py | 344 +- .../norm_judge_public_data_judicial_source.py | 353 +- ...ge_public_data_name_history_array_inner.py | 393 +- unicourt/model/norm_judge_search_response.py | 435 +- unicourt/model/norm_judge_search_result.py | 406 +- unicourt/model/norm_law_firm.py | 406 +- .../model/norm_law_firm_search_response.py | 435 +- unicourt/model/norm_law_firm_search_result.py | 406 +- unicourt/model/norm_organization.py | 549 +- .../norm_organization_ticker_array_inner.py | 319 +- unicourt/model/norm_party.py | 463 +- unicourt/model/norm_party_search_response.py | 435 +- unicourt/model/norm_party_search_result.py | 418 +- unicourt/model/pacer_case_search_content.py | 968 +- unicourt/model/pacer_case_search_results.py | 359 +- unicourt/model/pacer_credential.py | 354 +- .../model/pacer_credential_list_response.py | 407 +- unicourt/model/pacer_credential_request.py | 350 +- unicourt/model/pacer_import_case.py | 348 +- unicourt/model/pacer_import_case_results.py | 339 +- unicourt/model/pacer_party_search_content.py | 589 +- unicourt/model/pacer_party_search_results.py | 359 +- unicourt/model/pacer_search_page_info.py | 377 +- unicourt/model/pacer_search_receipt.py | 462 +- unicourt/model/parties.py | 384 +- unicourt/model/party.py | 579 +- unicourt/model/party_analytics_api.py | 409 +- unicourt/model/party_attorney_association.py | 361 +- unicourt/model/party_attorney_associations.py | 384 +- unicourt/model/party_role.py | 397 +- unicourt/model/party_role_group.py | 369 +- unicourt/model/party_role_group_response.py | 411 +- unicourt/model/party_role_response.py | 411 +- unicourt/model/pcl_case.py | 417 +- unicourt/model/pcl_party.py | 417 +- unicourt/model/phone.py | 390 +- unicourt/model/possible_norm_attorney.py | 448 +- ...ssible_norm_attorney_score_constituents.py | 455 +- unicourt/model/possible_norm_judge.py | 442 +- .../possible_norm_judge_score_constituents.py | 397 +- unicourt/model/possible_norm_law_firm.py | 462 +- ...ssible_norm_law_firm_score_constituents.py | 423 +- .../possible_norm_law_firm_source_details.py | 340 +- unicourt/model/possible_norm_party.py | 448 +- .../possible_norm_party_score_constituents.py | 423 +- unicourt/model/preview_document.py | 360 +- unicourt/model/raw_ordered_data.py | 367 +- unicourt/model/raw_ordered_data_child.py | 367 +- ...aw_ordered_data_child_child_array_inner.py | 353 +- unicourt/model/referenced_docket_number.py | 333 +- unicourt/model/related_case.py | 436 +- unicourt/model/related_cases.py | 384 +- unicourt/model/related_norm_party.py | 354 +- unicourt/model/schedule.py | 352 +- unicourt/model/service_history.py | 453 +- unicourt/model/service_status.py | 374 +- unicourt/model/service_status_down_details.py | 376 +- unicourt/model/similar_norm_attorney.py | 384 +- .../model/sos_associated_norm_organization.py | 419 +- unicourt/model/sos_data.py | 559 +- unicourt/model/sos_data_preview.py | 332 +- unicourt/model/sos_name_change.py | 362 +- unicourt/model/source_case_data.py | 436 +- unicourt/model/source_cause_of_action.py | 403 +- unicourt/model/source_charge.py | 452 +- .../model/source_charge_additional_data.py | 336 +- unicourt/model/source_page_data.py | 372 +- unicourt/model/source_structured_data.py | 334 +- unicourt/model/success.py | 323 +- unicourt/model_utils.py | 2066 -- unicourt/py.typed | 0 unicourt/rest.py | 379 +- unicourt/sdk/AttorneyAnalytics.py | 986 +- unicourt/sdk/Authentication.py | 133 +- unicourt/sdk/Callback.py | 164 +- unicourt/sdk/CaseAnalytics.py | 3054 +- unicourt/sdk/CaseDocket.py | 2381 +- unicourt/sdk/CaseDocuments.py | 995 +- unicourt/sdk/CaseExport.py | 462 +- unicourt/sdk/CaseSearch.py | 336 +- unicourt/sdk/CaseTracking.py | 606 +- unicourt/sdk/CaseUpdate.py | 470 +- unicourt/sdk/CourtAvailability.py | 155 +- unicourt/sdk/CourtStandards.py | 9398 +++++- unicourt/sdk/JudgeAnalytics.py | 986 +- unicourt/sdk/LawFirmAnalytics.py | 986 +- unicourt/sdk/PACER.py | 4293 ++- unicourt/sdk/PACERCredential.py | 587 +- unicourt/sdk/PartyAnalytics.py | 986 +- unicourt/sdk/Usage.py | 435 +- unicourt/sdk/__init__.py | 21 +- unicourt/sdk_response.py | 18 + unicourt/utils.py | 2 - 334 files changed, 102219 insertions(+), 112272 deletions(-) create mode 100644 CHANGELOG.rst create mode 100644 pyproject.toml mode change 100755 => 100644 unicourt/api_client.py create mode 100644 unicourt/api_response.py create mode 100644 unicourt/constants.py delete mode 100644 unicourt/model/callback_list_response_case_export_callbacks.py delete mode 100755 unicourt/model_utils.py create mode 100644 unicourt/py.typed create mode 100644 unicourt/sdk_response.py diff --git a/CHANGELOG.rst b/CHANGELOG.rst new file mode 100644 index 0000000..f881724 --- /dev/null +++ b/CHANGELOG.rst @@ -0,0 +1,7 @@ +SDK Release Note +----------------- +* SDK upgrade from current version 1.0.1 to new version 1.1.0 +* Supports OAS 3.1 standards +* JSON schema validation of request and response objects +* SDK objects are python objects so can be pickled and unpickled +* Supports python version >= 3.7 \ No newline at end of file diff --git a/README.md b/README.md index ed1a545..d9c8f16 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ See the UniCourt data model here (requires UniCourt account): [UniCourt Data Mod ### Requirements -- Python >=3.6 +- Python >=3.7 ## Installation You can use the source code if you want to modify the package and use it as per your need. If you just want to use the package, just run: @@ -21,7 +21,6 @@ pip install --upgrade unicourt Install from source : ```sh -export SDK_VERSION= python setup.py install ``` @@ -79,6 +78,30 @@ for attorney in attorney_obj.norm_attorney_search_result_array: # Invalidate the generated access token Authentication.invalidate_token() +``` - -``` \ No newline at end of file +## Python Error Exceptions +SDK will throw Python error exceptions in the below mentioned scenario's. +- When the request agruments or data passed to the SDK functions are incorrect. + + Example : + ``` + Callback.get_callbacks() got an unexpected keyword argument 'vardate' + ``` +- When the sever sends any error response. + + Example : + ``` + Reason: Internal Server Error + HTTP response headers: HTTPHeaderDict({'Date': 'Tue, 13 Aug 2024 09:31:41 GMT', 'Content-Type': 'application/json', 'Content-Length': '145', 'Connection': 'keep-alive', 'Apigw-Requestid': 'ccMvJhfYoAMEWzA='}) + HTTP response body: {"object": "Exception", "code": "UN500", "message": "INTERNAL_SERVER_ERROR", "details": "Has encountered a situation which needs to be handled."} + ``` +- When the response has any new values which are not supported by the SDK. This can occur only when using the older version of SDK. + + Example : + ``` + 1 validation error for ServiceStatusDownDetails + reason + Value error, must be one of enum values ('issueAtTheCourtSource', 'notIntegrated', 'brokenIntegration') [type=value_error, input_value='underMaintenance', input_type=str] + For further information visit https://errors.pydantic.dev/2.8/v/value_error + ``` \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b501bde --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,71 @@ +[tool.poetry] +name = "unicourt" +version = "1.1.0" +description = "UniCourt Enterprise APIs" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" +keywords = ["OpenAPI", "OpenAPI-Generator", "UniCourt Enterprise APIs"] +include = ["unicourt/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" +types-python-dateutil = ">=2.8.19.14" +mypy = "1.4.1" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "unicourt", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +strict_concatenate = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true diff --git a/requirements.txt b/requirements.txt index 96947f6..cc85509 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 -urllib3 >= 1.25.3 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/setup.py b/setup.py index a9b8086..072b524 100644 --- a/setup.py +++ b/setup.py @@ -1,18 +1,38 @@ +# coding: utf-8 + import os -from setuptools import setup, find_packages +from setuptools import setup, find_packages # noqa: H301 + here = os.path.abspath(os.path.dirname(__file__)) os.chdir(here) -NAME = "unicourt" -VERSION = os.getenv("SDK_VERSION") +def _read(filename): + with open(os.path.join(os.path.dirname(__file__), filename)) as f: + return f.read() + +def _generate_description(): + description = [] + description.append("The UniCourt Python Package provides simplified access to the UniCourt API for applications written in the Python programming language. Documentation of UniCourt's APIs can be found at docs.unicourt.com. API keys can be obtained by filling out the form here https://unicourt.com/contact-us/?c=sales&enterprise=1 \n") + changelog_file = os.getenv("CHANGELOG_FILE") + if changelog_file: + description.append(_read("CHANGELOG.rst")) + return "\n".join(description) + # To install the library, run the following # # python setup.py install # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools - -REQUIRES = ["python_dateutil >= 2.5.3", "urllib3 >= 1.25.3"] +NAME = "unicourt" +VERSION = "1.1.0" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = [ + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] setup( name=NAME, @@ -24,14 +44,14 @@ url="https://unicourt.com/", project_urls={ "Source": "https://github.com/UniCourt/enterprise-api-py-sdk/tree/main", - "Documentation": "https://docs.unicourt.com/", + "Documentation": "https://docs.unicourt.com/knowledge-base/python-sdk", }, keywords=["UniCourt", "UniCourt Python Package", "UniCourt Enterprise APIs"], - python_requires=">=3.6", + python_requires=PYTHON_REQUIRES, install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, - long_description="""The UniCourt Python Package provides simplified access to the UniCourt API for applications written in the Python programming language. Documentation of UniCourt's APIs can be found at docs.unicourt.com. API keys can be obtained by filling out the form here https://unicourt.com/contact-us/?c=sales&enterprise=1 - """ + long_description=_generate_description(), + package_data={"unicourt": ["py.typed"]}, ) diff --git a/test/README.md b/test/README.md index 623ec1d..2ad4fca 100644 --- a/test/README.md +++ b/test/README.md @@ -2,7 +2,7 @@ ## Getting started -To run the SDK tests you need python >= 3.6 and Git installed. +To run the SDK tests you need python >= 3.7 and Git installed. ## Test Parameters - Run all tests diff --git a/test/base.py b/test/base.py index dbf1b8d..855d90b 100644 --- a/test/base.py +++ b/test/base.py @@ -19,10 +19,14 @@ def __init__(self) -> None: def run(self): args = self.parser.parse_args() - # getting the list of test file and re-order authentication test file at end to run. + + # Getting the list of test file. module_list = [re.sub("\.py", "", module) for module in os.listdir() if module.startswith("test") and module.endswith("py")] + + # Re-order authentication test file at end to run. index = module_list.index('test_authentication_api') module_list[index], module_list[-1] = module_list[-1], module_list[index] + for module_name in module_list: module = __import__(module_name) class_name = [class_name for class_name in dir(module) if class_name.startswith('Test')][0] diff --git a/test/test_attorney_analytics_api.py b/test/test_attorney_analytics_api.py index 7cc7932..c6e357b 100644 --- a/test/test_attorney_analytics_api.py +++ b/test/test_attorney_analytics_api.py @@ -2,7 +2,6 @@ class TestAttorneyAnalytics: - def test_get_norm_attorney_by_id(): return AttorneyAnalytics.get_norm_attorney_by_id( norm_attorney_id="NATYs4P6kDBkhKL8CF") diff --git a/test/test_authentication_api.py b/test/test_authentication_api.py index 21e8a7b..5574049 100644 --- a/test/test_authentication_api.py +++ b/test/test_authentication_api.py @@ -3,7 +3,6 @@ class TestAuthentication: - def test_list_all_token_ids(): return Authentication.list_all_token_ids() diff --git a/test/test_case_analytics_api.py b/test/test_case_analytics_api.py index b6ad0ff..c55b62f 100644 --- a/test/test_case_analytics_api.py +++ b/test/test_case_analytics_api.py @@ -82,7 +82,6 @@ def test_get_case_count_analytics_by_norm_law_firm(): ) def test_get_case_count_analytics_by_norm_party(): - return CaseAnalytics.get_case_count_analytics_by_norm_party( page_number=1, q='caseTypeId:"CTYPATMYyaJekdgj2c" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]' diff --git a/test/test_case_docket_api.py b/test/test_case_docket_api.py index cafa5a4..fc4e031 100644 --- a/test/test_case_docket_api.py +++ b/test/test_case_docket_api.py @@ -2,24 +2,20 @@ class TestCaseDocket: - # def test_get_attorney_associated_parties(): - # return CaseDocket.get_attorney_associated_parties( - # attorney_id='ATTYgu01be2e4de654' - # ) - - # def test_get_attorney_by_id(): - # return CaseDocket.get_attorney_by_id( - # attorney_id='ATTYgu01be2e4de654') + def test_get_attorney_associated_parties(): + return CaseDocket.get_attorney_associated_parties( + attorney_id='ATTYgu01be2e4de654' + ) - # def test_get_case(): - # return CaseDocket.get_case( - # case_id='CASEakfbd1817d7431', - # ) + def test_get_attorney_by_id(): + return CaseDocket.get_attorney_by_id( + attorney_id='ATTYgu01be2e4de654' + ) - # def test_get_case_sealed_case(): - # return CaseDocket.get_case( - # case_id='CASEakfbd1817d7431', - # ) + def test_get_case(): + return CaseDocket.get_case( + case_id='CASEakfbd1817d7431', + ) def test_get_case_attorneys(): return CaseDocket.get_case_attorneys( diff --git a/test/test_case_document_api.py b/test/test_case_document_api.py index 0c30cda..da08dbd 100644 --- a/test/test_case_document_api.py +++ b/test/test_case_document_api.py @@ -1,14 +1,12 @@ -from unicourt.model.case_document_order_pacer_options import CaseDocumentOrderPacerOptions from unicourt.model.case_document_order_request import CaseDocumentOrderRequest from unicourt.sdk.CaseDocuments import CaseDocuments class TestCaseDocuments: - def test_get_case_document_download_by_id_with_no_preview(): return CaseDocuments.get_case_document_download_by_id( case_document_id='CDOCaqe42a86394f63', - is_preview_document=True + is_preview_document=False ) def test_get_case_document_download_by_id_with_preview(): @@ -18,42 +16,19 @@ def test_get_case_document_download_by_id_with_preview(): is_preview_document=True ) - # case_document_order_request = CaseDocumentOrderRequest( - # case_document_id="CDOCcre989d654fa05", - # is_preview_only=True, - # pacer_options=CaseDocumentOrderPacerOptions( - # pacer_user_id="URKYwer3tyh5r56gq2", - # pacer_client_code="Test UniCourt API", - # ), - # ) - - def test_order_case_document(): - case_document_order_request = CaseDocumentOrderRequest( - case_document_id="CDOCcre989d654fa05", - is_preview_only=True - ) - return CaseDocuments.order_case_document( - case_document_order_request=case_document_order_request - ) - def test_get_case_document_order_callback_by_id(): case_document_order_request = CaseDocumentOrderRequest( case_document_id="CDOCcre989d654fa05", is_preview_only=True ) - response = CaseDocuments.order_case_document( + response, _ = CaseDocuments.order_case_document( case_document_order_request=case_document_order_request ) - cbk_id = response[0]['case_document_order_callback_id'] + cbk_id = response.case_document_order_callback_id return CaseDocuments.get_case_document_order_callback_by_id( case_document_order_callback_id=cbk_id ) - def test_get_document_by_id(): - return CaseDocuments.get_document_by_id( - case_document_id='CDOCaqe42a86394f63' - ) - def test_get_case_document_order_callbacks(): return CaseDocuments.get_case_document_order_callbacks( date='2022-03-08T10:17:56+00:00', status='FAILURE', page_number=1 @@ -63,3 +38,17 @@ def test_get_case_documents(): return CaseDocuments.get_case_documents( case_id='CASEgua4c06e119ea8' ) + + def test_get_document_by_id(): + return CaseDocuments.get_document_by_id( + case_document_id='CDOCaqe42a86394f63' + ) + + def test_order_case_document(): + case_document_order_request = CaseDocumentOrderRequest( + case_document_id="CDOCcre989d654fa05", + is_preview_only=True + ) + return CaseDocuments.order_case_document( + case_document_order_request=case_document_order_request + ) diff --git a/test/test_case_tracking_api.py b/test/test_case_tracking_api.py index 2a5b936..2cc528a 100644 --- a/test/test_case_tracking_api.py +++ b/test/test_case_tracking_api.py @@ -5,28 +5,6 @@ class TestCaseTracking: - - # case_track_request = CaseTrackRequest( - # case_track_params=CaseUpdateRequest( - # case_id="CASEhq9d8b72d0800c", - # pacer_options=CaseUpdatePacerOptions( - # pacer_user_id="URKYwer3tyh5r56gq2", - # pacer_client_code="Test UniCourt API", - # fetch_participants_if_older_than_days=30, - # refresh_type="fetchNewDocketEntries", - # additional_page_array=[ - # CaseUpdatePacerOptionsAdditionalPageArrayInner( - # page="caseSummary", - # fetch_if_older_than_days=30, - # ), - # ], - # ), - # ), - # schedule=CaseTrackSchedule( - # type="weekly", - # days=[1,3,5], - # ), - # ) def test_track_case(): return CaseTracking.track_case( case_track_request=CaseTrackRequest( diff --git a/test/test_case_update_api.py b/test/test_case_update_api.py index fcc7469..72c758b 100644 --- a/test/test_case_update_api.py +++ b/test/test_case_update_api.py @@ -1,26 +1,8 @@ -from unicourt.model.case_document_order_request import CaseDocumentOrderRequest from unicourt.model.case_update_request import CaseUpdateRequest -from unicourt.sdk.CaseDocuments import CaseDocuments from unicourt.sdk.CaseUpdate import CaseUpdate class TestCaseUpdate: - - # case_update_request = CaseUpdateRequest( - # case_id="CASEhq9d8b72d0800c", - # pacer_options=CaseUpdatePacerOptions( - # pacer_user_id="URKYwer3tyh5r56gq2", - # pacer_client_code="Test UniCourt API", - # fetch_participants_if_older_than_days=30, - # refresh_type="fetchNewDocketEntries", - # additional_page_array=[ - # CaseUpdatePacerOptionsAdditionalPageArrayInner( - # page="caseSummary", - # fetch_if_older_than_days=30, - # ), - # ], - # ), - # ) def test_update_case(): return CaseUpdate.update_case( case_update_request=CaseUpdateRequest( @@ -28,6 +10,11 @@ def test_update_case(): ) ) + def test_get_case_update_by_case_id(): + return CaseUpdate.get_case_update_by_case_id( + case_id="CASEhq9d8b72d0800c" + ) + def test_get_case_updates(): return CaseUpdate.get_case_updates( case_id="CASEak99a698ea5413", @@ -35,7 +22,3 @@ def test_get_case_updates(): status="IN_PROGRESS", page_number=1, ) - - def test_get_case_update_by_case_id(): - return CaseUpdate.get_case_update_by_case_id( - case_id="CASEhq9d8b72d0800c") diff --git a/test/test_court_availability_api.py b/test/test_court_availability_api.py index 1cfaa3d..8f79034 100644 --- a/test/test_court_availability_api.py +++ b/test/test_court_availability_api.py @@ -4,12 +4,5 @@ class TestCourtAvailability: def test_get_court_coverage(): return CourtAvailability.get_court_coverage( - court_id="CORTV4vCEaKrhystBz") - - -def main(): - TestCourtAvailability().run() - - -if __name__ == "__main__": - main() + court_id="CORTV4vCEaKrhystBz" + ) diff --git a/test/test_court_standards_api.py b/test/test_court_standards_api.py index 426c485..1c11dbd 100644 --- a/test/test_court_standards_api.py +++ b/test/test_court_standards_api.py @@ -2,24 +2,23 @@ class TestCourtStandards: - def test_get_appeal_courts_for_court(): - return CourtStandards. get_appeal_courts_for_court( + return CourtStandards.get_appeal_courts_for_court( court_id='CORThSxcef8eGUSkuC' ) def test_get_area_of_law(): - return CourtStandards. get_area_of_law( + return CourtStandards.get_area_of_law( area_of_law_id='AOFLGAd9Ah5qkTRNw9' ) def test_get_areas_of_law(): - return CourtStandards. get_areas_of_law( + return CourtStandards.get_areas_of_law( q='areaOfLawId: "AOFLGAd9Ah5qkTRNw9"' ) def test_get_attorney_representation_type(): - return CourtStandards. get_attorney_representation_type( + return CourtStandards.get_attorney_representation_type( attorney_representation_type_id='ATRPYgPMGJufoCsR6Q' ) @@ -98,6 +97,21 @@ def test_get_cases_status(): q='caseStatusId: "CSSTBtqf3R2LYFt4j4"' ) + def test_get_cause_of_action(): + return CourtStandards.get_cause_of_action( + cause_of_action_id = 'CATNoLU7sWaGjWtkBx' + ) + + def test_get_cause_of_action_additional_data(): + return CourtStandards.get_cause_of_action_additional_data( + cause_of_action_additional_data_id = 'CAADoLU7sWaGjWtkBx' + ) + + def test_get_cause_of_action_group(): + return CourtStandards.get_cause_of_action_group( + cause_of_action_group_id = 'CAGPoLU7sWaGjWtkBx' + ) + def test_get_causes_of_action(): return CourtStandards.get_causes_of_action( q='causeOfActionGroupId:"CAGPiHoKn66p3bkcNs"' @@ -113,6 +127,56 @@ def test_get_causes_of_action_group(): q='causeOfActionGroupId:"CAGPiHoKn66p3bkcNs"' ) + def test_get_charge(): + return CourtStandards.get_charge( + charge_id = 'CHRGiHoKn66p3bkcNs' + ) + + def test_get_charge_additional_data(): + return CourtStandards.get_charge_additional_data( + charge_additional_data_id = 'CHADiHoKn66p3bkcNs' + ) + + def test_get_charge_degree(): + return CourtStandards.get_charge_degree( + charge_degree_id = 'CHDGiHoKn66p3bkcNs' + ) + + def test_get_charge_group(): + return CourtStandards.get_charge_group( + charge_group_id = 'CHGPiHoKn66p3bkcNs' + ) + + def test_get_charge_groups(): + return CourtStandards.get_charge_groups( + q = 'chargeGroupId:"CHRGoLU7sWaGjWtkBx"' + ) + + def test_get_charge_severity(): + return CourtStandards.get_charge_severity( + charge_severity_id = 'CHSEiHoKn66p3bkcNs' + ) + + def test_get_charges(): + return CourtStandards.get_charges( + q='chargeId:"CHRGoLU7sWaGjWtkBx"' + ) + + def test_get_charges_additional_data(): + return CourtStandards.get_charges_additional_data( + q = 'chargeAdditionalDataId:"CHADoLU7sWaGjWtkBx"' + ) + + def test_get_charges_degree(): + return CourtStandards.get_charges_degree( + q = 'chargeDegreeId:"CHDGiHoKn66p3bkcNs"' + ) + + def test_get_charges_severity(): + return CourtStandards.get_charges_severity( + q = 'chargeSeverityId:"CHSEiHoKn66p3bkcNs"' + ) + def test_get_court(): return CourtStandards.get_court( court_id='CORThSxcef8eGUSkuC' @@ -210,7 +274,6 @@ def test_get_party_role(): def test_get_party_role_group(): return CourtStandards.get_party_role_group( party_role_group_id='PTYGBnjxbx6tKNfVEP' - ) def test_get_party_role_groups(): diff --git a/test/test_law_firm_analytics_api.py b/test/test_law_firm_analytics_api.py index 12eea14..7188478 100644 --- a/test/test_law_firm_analytics_api.py +++ b/test/test_law_firm_analytics_api.py @@ -37,11 +37,3 @@ def test_search_normalized_law_firms_by_id(): return LawFirmAnalytics.search_normalized_law_firms_by_id( norm_law_firm_search_id='LSRCeCT9pC3maopkW7' ) - - -def main(): - TestLawFirmAnalytics().run() - - -if __name__ == "__main__": - main() diff --git a/test/test_pacer_api.py b/test/test_pacer_api.py index b1eba9b..4fbd4df 100644 --- a/test/test_pacer_api.py +++ b/test/test_pacer_api.py @@ -3,15 +3,14 @@ class TestPacer: - def test_all_courts_pacer_case_locator_case_search(): - return PACER. all_courts_pacer_case_locator_case_search( + return PACER.all_courts_pacer_case_locator_case_search( pacer_user_id=os.getenv("PACER_USER_ID"), pacer_client_code=os.getenv("PACER_CLIENT_CODE"), case_number="12-1234") def test_all_courts_pacer_case_locator_party_search(): - return PACER. all_courts_pacer_case_locator_party_search( + return PACER.all_courts_pacer_case_locator_party_search( pacer_user_id=os.getenv("PACER_USER_ID"), pacer_client_code=os.getenv("PACER_CLIENT_CODE"), last_name="smith", @@ -19,7 +18,7 @@ def test_all_courts_pacer_case_locator_party_search(): ) def test_appeal_courts_pacer_case_locator_case_search(): - return PACER. appeal_courts_pacer_case_locator_case_search( + return PACER.appeal_courts_pacer_case_locator_case_search( pacer_user_id=os.getenv("PACER_USER_ID"), pacer_client_code=os.getenv("PACER_CLIENT_CODE"), case_number="12-1234" @@ -33,21 +32,21 @@ def test_appeal_courts_pacer_case_locator_party_search(): ) def test_bankruptcy_courts_pacer_case_locator_case_search(): - return PACER. bankruptcy_courts_pacer_case_locator_case_search( + return PACER.bankruptcy_courts_pacer_case_locator_case_search( pacer_user_id=os.getenv("PACER_USER_ID"), pacer_client_code=os.getenv("PACER_CLIENT_CODE"), case_number="12-1234" ) def test_bankruptcy_courts_pacer_case_locator_party_search(): - return PACER. bankruptcy_courts_pacer_case_locator_party_search( + return PACER.bankruptcy_courts_pacer_case_locator_party_search( pacer_user_id=os.getenv("PACER_USER_ID"), pacer_client_code=os.getenv("PACER_CLIENT_CODE"), last_name="smith" ) def test_civil_courts_pacer_case_locator_case_search(): - return PACER. civil_courts_pacer_case_locator_case_search( + return PACER.civil_courts_pacer_case_locator_case_search( pacer_user_id=os.getenv("PACER_USER_ID"), pacer_client_code=os.getenv("PACER_CLIENT_CODE"), case_number="12-1234" diff --git a/test/test_party_analytics_api.py b/test/test_party_analytics_api.py index 6d534b5..255e3ef 100644 --- a/test/test_party_analytics_api.py +++ b/test/test_party_analytics_api.py @@ -7,7 +7,6 @@ def test_get_norm_attorneys_associated_with_norm_party(): q='caseTypeId:"CTYPATMYyaJekdgj2c" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]', norm_party_id='NORGrPmQyLdx9NGHcT', page_number=1 - ) def test_get_norm_judges_associated_with_norm_party(): diff --git a/test/test_usage_api.py b/test/test_usage_api.py index 4b30441..079d3b4 100644 --- a/test/test_usage_api.py +++ b/test/test_usage_api.py @@ -6,7 +6,7 @@ def test_get_billing_cycles(): return Usage.get_billing_cycles() def test_get_billing_usage_by_billing_cycle(): - billing_obj, status = Usage.get_billing_cycles() + billing_obj, _ = Usage.get_billing_cycles() billing_cycle_date = billing_obj.billing_cycle_array[0] return Usage.get_billing_usage_by_billing_cycle( billing_cycle=billing_cycle_date) diff --git a/unicourt/__init__.py b/unicourt/__init__.py index 3282c3f..3e7ee6f 100644 --- a/unicourt/__init__.py +++ b/unicourt/__init__.py @@ -1,31 +1,297 @@ from unicourt.api_client import ApiClient from unicourt.configuration import Configuration +from unicourt.api_response import ApiResponse from unicourt.exceptions import OpenApiException from unicourt.exceptions import ApiAttributeError from unicourt.exceptions import ApiTypeError from unicourt.exceptions import ApiValueError from unicourt.exceptions import ApiKeyError -from unicourt.exceptions import ApiException +from unicourt.exceptions import ApiException +from unicourt.exceptions import SdkException -from unicourt.sdk.CaseUpdate import CaseUpdate -from unicourt.sdk.LawFirmAnalytics import LawFirmAnalytics -from unicourt.sdk.CaseDocuments import CaseDocuments -from unicourt.sdk.CourtStandards import CourtStandards -from unicourt.sdk.CaseSearch import CaseSearch -from unicourt.sdk.Callback import Callback -from unicourt.sdk.AttorneyAnalytics import AttorneyAnalytics from unicourt.sdk.PartyAnalytics import PartyAnalytics -from unicourt.sdk.Usage import Usage -from unicourt.sdk.CaseExport import CaseExport -from unicourt.sdk.Authentication import Authentication from unicourt.sdk.JudgeAnalytics import JudgeAnalytics -from unicourt.sdk.CaseTracking import CaseTracking +from unicourt.sdk.CaseAnalytics import CaseAnalytics +from unicourt.sdk.CaseUpdate import CaseUpdate +from unicourt.sdk.CaseExport import CaseExport +from unicourt.sdk.CourtAvailability import CourtAvailability from unicourt.sdk.PACER import PACER from unicourt.sdk.CaseDocket import CaseDocket -from unicourt.sdk.CaseAnalytics import CaseAnalytics from unicourt.sdk.PACERCredential import PACERCredential -from unicourt.sdk.CourtAvailability import CourtAvailability +from unicourt.sdk.Callback import Callback +from unicourt.sdk.CaseSearch import CaseSearch +from unicourt.sdk.Authentication import Authentication +from unicourt.sdk.AttorneyAnalytics import AttorneyAnalytics +from unicourt.sdk.CourtStandards import CourtStandards +from unicourt.sdk.CaseTracking import CaseTracking +from unicourt.sdk.CaseDocuments import CaseDocuments +from unicourt.sdk.Usage import Usage +from unicourt.sdk.LawFirmAnalytics import LawFirmAnalytics + +from unicourt.model.access_token_id_list_response import AccessTokenIdListResponse +from unicourt.model.access_token_id_response import AccessTokenIdResponse +from unicourt.model.access_token_request import AccessTokenRequest +from unicourt.model.access_token_response import AccessTokenResponse +from unicourt.model.additional_levels import AdditionalLevels +from unicourt.model.address import Address +from unicourt.model.area_of_law import AreaOfLaw +from unicourt.model.area_of_law_response import AreaOfLawResponse +from unicourt.model.associated_norm_attorney import AssociatedNormAttorney +from unicourt.model.associated_norm_attorney_response import AssociatedNormAttorneyResponse +from unicourt.model.associated_norm_judge import AssociatedNormJudge +from unicourt.model.associated_norm_judge_response import AssociatedNormJudgeResponse +from unicourt.model.associated_norm_law_firm import AssociatedNormLawFirm +from unicourt.model.associated_norm_law_firm_response import AssociatedNormLawFirmResponse +from unicourt.model.associated_norm_party import AssociatedNormParty +from unicourt.model.associated_norm_party_response import AssociatedNormPartyResponse +from unicourt.model.associated_so_s_person import AssociatedSoSPerson +from unicourt.model.attorney import Attorney +from unicourt.model.attorney_analytics_api import AttorneyAnalyticsAPI +from unicourt.model.attorney_law_firm import AttorneyLawFirm +from unicourt.model.attorney_representation_type import AttorneyRepresentationType +from unicourt.model.attorney_representation_type_response import AttorneyRepresentationTypeResponse +from unicourt.model.attorney_type import AttorneyType +from unicourt.model.attorney_type_response import AttorneyTypeResponse +from unicourt.model.attorneys import Attorneys +from unicourt.model.bar_record import BarRecord +from unicourt.model.bar_record_preview import BarRecordPreview +from unicourt.model.bar_source_data import BarSourceData +from unicourt.model.bar_source_data_administrative_actions_array_inner import BarSourceDataAdministrativeActionsArrayInner +from unicourt.model.bar_source_data_advanced_degree_array_inner import BarSourceDataAdvancedDegreeArrayInner +from unicourt.model.bar_source_data_bar_status_array_inner import BarSourceDataBarStatusArrayInner +from unicourt.model.bar_source_data_board_certifications_array_inner import BarSourceDataBoardCertificationsArrayInner +from unicourt.model.bar_source_data_committees_array_inner import BarSourceDataCommitteesArrayInner +from unicourt.model.bar_source_data_court_history_array_inner import BarSourceDataCourtHistoryArrayInner +from unicourt.model.bar_source_data_court_of_admissions import BarSourceDataCourtOfAdmissions +from unicourt.model.bar_source_data_disciplinary_history_array_inner import BarSourceDataDisciplinaryHistoryArrayInner +from unicourt.model.bar_source_data_discipline_summaries_array_inner import BarSourceDataDisciplineSummariesArrayInner +from unicourt.model.bar_source_data_employment_history_array_inner import BarSourceDataEmploymentHistoryArrayInner +from unicourt.model.bar_source_data_fees_options_array_inner import BarSourceDataFeesOptionsArrayInner +from unicourt.model.bar_source_data_involvements_array_inner import BarSourceDataInvolvementsArrayInner +from unicourt.model.bar_source_data_law_school_array_inner import BarSourceDataLawSchoolArrayInner +from unicourt.model.bar_source_data_name import BarSourceDataName +from unicourt.model.bar_source_data_open_action_status_array_inner import BarSourceDataOpenActionStatusArrayInner +from unicourt.model.bar_source_data_other_jurisdiction_array_inner import BarSourceDataOtherJurisdictionArrayInner +from unicourt.model.bar_source_data_public_hearing_array_inner import BarSourceDataPublicHearingArrayInner +from unicourt.model.bar_source_data_reason_for_inactivation import BarSourceDataReasonForInactivation +from unicourt.model.bar_source_data_related_cases_array_inner import BarSourceDataRelatedCasesArrayInner +from unicourt.model.bar_source_data_source_info import BarSourceDataSourceInfo +from unicourt.model.bar_source_data_statewide_grievance_committee_history_array_inner import BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner +from unicourt.model.bar_source_data_status_history_array_inner import BarSourceDataStatusHistoryArrayInner +from unicourt.model.bar_source_data_ten_year_discipline_array_inner import BarSourceDataTenYearDisciplineArrayInner +from unicourt.model.billing_cycle_usage_response import BillingCycleUsageResponse +from unicourt.model.billing_cycle_usage_response_api_calls_billable import BillingCycleUsageResponseApiCallsBillable +from unicourt.model.billing_cycle_usage_response_api_calls_credited import BillingCycleUsageResponseApiCallsCredited +from unicourt.model.billing_cycle_usage_response_api_calls_made import BillingCycleUsageResponseApiCallsMade +from unicourt.model.billing_cycle_usage_response_billing_cycle import BillingCycleUsageResponseBillingCycle +from unicourt.model.billing_cycles_response import BillingCyclesResponse +from unicourt.model.callback_list_response import CallbackListResponse +from unicourt.model.callback_list_response_case_document_order_callbacks import CallbackListResponseCaseDocumentOrderCallbacks +from unicourt.model.case import Case +from unicourt.model.case_analytics_api import CaseAnalyticsAPI +from unicourt.model.case_cause_of_action import CaseCauseOfAction +from unicourt.model.case_charge import CaseCharge +from unicourt.model.case_class import CaseClass +from unicourt.model.case_class_coverage import CaseClassCoverage +from unicourt.model.case_class_response import CaseClassResponse +from unicourt.model.case_count_analytics_by_area_of_law import CaseCountAnalyticsByAreaOfLaw +from unicourt.model.case_count_analytics_by_area_of_law_response import CaseCountAnalyticsByAreaOfLawResponse +from unicourt.model.case_count_analytics_by_case_class import CaseCountAnalyticsByCaseClass +from unicourt.model.case_count_analytics_by_case_class_response import CaseCountAnalyticsByCaseClassResponse +from unicourt.model.case_count_analytics_by_case_filed_date import CaseCountAnalyticsByCaseFiledDate +from unicourt.model.case_count_analytics_by_case_filed_date_response import CaseCountAnalyticsByCaseFiledDateResponse +from unicourt.model.case_count_analytics_by_case_type import CaseCountAnalyticsByCaseType +from unicourt.model.case_count_analytics_by_case_type_group import CaseCountAnalyticsByCaseTypeGroup +from unicourt.model.case_count_analytics_by_case_type_group_response import CaseCountAnalyticsByCaseTypeGroupResponse +from unicourt.model.case_count_analytics_by_case_type_response import CaseCountAnalyticsByCaseTypeResponse +from unicourt.model.case_count_analytics_by_court import CaseCountAnalyticsByCourt +from unicourt.model.case_count_analytics_by_court_geo import CaseCountAnalyticsByCourtGeo +from unicourt.model.case_count_analytics_by_court_location import CaseCountAnalyticsByCourtLocation +from unicourt.model.case_count_analytics_by_court_location_response import CaseCountAnalyticsByCourtLocationResponse +from unicourt.model.case_count_analytics_by_court_response import CaseCountAnalyticsByCourtResponse +from unicourt.model.case_count_analytics_by_court_system import CaseCountAnalyticsByCourtSystem +from unicourt.model.case_count_analytics_by_court_system_response import CaseCountAnalyticsByCourtSystemResponse +from unicourt.model.case_count_analytics_by_court_type import CaseCountAnalyticsByCourtType +from unicourt.model.case_count_analytics_by_court_type_response import CaseCountAnalyticsByCourtTypeResponse +from unicourt.model.case_count_analytics_by_jurisdiction_geo import CaseCountAnalyticsByJurisdictionGeo +from unicourt.model.case_count_analytics_by_jurisdiction_geo_response import CaseCountAnalyticsByJurisdictionGeoResponse +from unicourt.model.case_count_analytics_by_norm_attorney import CaseCountAnalyticsByNormAttorney +from unicourt.model.case_count_analytics_by_norm_attorney_response import CaseCountAnalyticsByNormAttorneyResponse +from unicourt.model.case_count_analytics_by_norm_judge import CaseCountAnalyticsByNormJudge +from unicourt.model.case_count_analytics_by_norm_judge_response import CaseCountAnalyticsByNormJudgeResponse +from unicourt.model.case_count_analytics_by_norm_law_firm import CaseCountAnalyticsByNormLawFirm +from unicourt.model.case_count_analytics_by_norm_law_firm_response import CaseCountAnalyticsByNormLawFirmResponse +from unicourt.model.case_count_analytics_by_norm_party import CaseCountAnalyticsByNormParty +from unicourt.model.case_count_analytics_by_norm_party_response import CaseCountAnalyticsByNormPartyResponse +from unicourt.model.case_count_analytics_by_party_role import CaseCountAnalyticsByPartyRole +from unicourt.model.case_count_analytics_by_party_role_group import CaseCountAnalyticsByPartyRoleGroup +from unicourt.model.case_count_analytics_by_party_role_group_response import CaseCountAnalyticsByPartyRoleGroupResponse +from unicourt.model.case_count_analytics_by_party_role_response import CaseCountAnalyticsByPartyRoleResponse +from unicourt.model.case_document import CaseDocument +from unicourt.model.case_document_order_callback import CaseDocumentOrderCallback +from unicourt.model.case_document_order_callback_list_response import CaseDocumentOrderCallbackListResponse +from unicourt.model.case_document_order_pacer_options import CaseDocumentOrderPacerOptions +from unicourt.model.case_document_order_request import CaseDocumentOrderRequest +from unicourt.model.case_documents import CaseDocuments +from unicourt.model.case_export_callback import CaseExportCallback +from unicourt.model.case_export_callback_list_response import CaseExportCallbackListResponse +from unicourt.model.case_relationship_type import CaseRelationshipType +from unicourt.model.case_relationship_type_response import CaseRelationshipTypeResponse +from unicourt.model.case_search_response import CaseSearchResponse +from unicourt.model.case_search_result import CaseSearchResult +from unicourt.model.case_stats import CaseStats +from unicourt.model.case_status import CaseStatus +from unicourt.model.case_status_group import CaseStatusGroup +from unicourt.model.case_status_group_response import CaseStatusGroupResponse +from unicourt.model.case_status_response import CaseStatusResponse +from unicourt.model.case_timeline import CaseTimeline +from unicourt.model.case_track import CaseTrack +from unicourt.model.case_track_list_response import CaseTrackListResponse +from unicourt.model.case_track_preview import CaseTrackPreview +from unicourt.model.case_track_request import CaseTrackRequest +from unicourt.model.case_track_schedule import CaseTrackSchedule +from unicourt.model.case_type import CaseType +from unicourt.model.case_type_group import CaseTypeGroup +from unicourt.model.case_type_group_response import CaseTypeGroupResponse +from unicourt.model.case_type_response import CaseTypeResponse +from unicourt.model.case_update import CaseUpdate +from unicourt.model.case_update_list_response import CaseUpdateListResponse +from unicourt.model.case_update_pacer_options import CaseUpdatePacerOptions +from unicourt.model.case_update_pacer_options_additional_page_array_inner import CaseUpdatePacerOptionsAdditionalPageArrayInner +from unicourt.model.case_update_pacer_options_response import CaseUpdatePacerOptionsResponse +from unicourt.model.case_update_preview import CaseUpdatePreview +from unicourt.model.case_update_request import CaseUpdateRequest +from unicourt.model.cause_of_action import CauseOfAction +from unicourt.model.cause_of_action_additional_data import CauseOfActionAdditionalData +from unicourt.model.cause_of_action_additional_data_response import CauseOfActionAdditionalDataResponse +from unicourt.model.cause_of_action_group import CauseOfActionGroup +from unicourt.model.cause_of_action_group_response import CauseOfActionGroupResponse +from unicourt.model.cause_of_action_response import CauseOfActionResponse +from unicourt.model.charge import Charge +from unicourt.model.charge_additional_data import ChargeAdditionalData +from unicourt.model.charge_additional_data_response import ChargeAdditionalDataResponse +from unicourt.model.charge_degree import ChargeDegree +from unicourt.model.charge_degree_response import ChargeDegreeResponse +from unicourt.model.charge_group import ChargeGroup +from unicourt.model.charge_group_response import ChargeGroupResponse +from unicourt.model.charge_response import ChargeResponse +from unicourt.model.charge_severity import ChargeSeverity +from unicourt.model.charge_severity_response import ChargeSeverityResponse +from unicourt.model.contact import Contact +from unicourt.model.court import Court +from unicourt.model.court_coverage import CourtCoverage +from unicourt.model.court_location import CourtLocation +from unicourt.model.court_location_response import CourtLocationResponse +from unicourt.model.court_response import CourtResponse +from unicourt.model.court_service_status import CourtServiceStatus +from unicourt.model.court_service_status_response import CourtServiceStatusResponse +from unicourt.model.court_system import CourtSystem +from unicourt.model.court_system_response import CourtSystemResponse +from unicourt.model.court_type import CourtType +from unicourt.model.court_type_response import CourtTypeResponse +from unicourt.model.daily_usage_response import DailyUsageResponse +from unicourt.model.docket_entries import DocketEntries +from unicourt.model.docket_entry import DocketEntry +from unicourt.model.docket_entry_primary_documents import DocketEntryPrimaryDocuments +from unicourt.model.docket_entry_secondary_documents import DocketEntrySecondaryDocuments +from unicourt.model.document_download import DocumentDownload +from unicourt.model.email import Email +from unicourt.model.exception import Exception +from unicourt.model.export_file import ExportFile +from unicourt.model.extracted_fields import ExtractedFields +from unicourt.model.hearing import Hearing +from unicourt.model.hearings import Hearings +from unicourt.model.individual import Individual +from unicourt.model.invalidate_access_token_request import InvalidateAccessTokenRequest +from unicourt.model.judge import Judge +from unicourt.model.judge_analytics_api import JudgeAnalyticsAPI +from unicourt.model.judge_type import JudgeType +from unicourt.model.judge_type_response import JudgeTypeResponse +from unicourt.model.judges import Judges +from unicourt.model.jurisdiction_geo import JurisdictionGeo +from unicourt.model.jurisdiction_geo_response import JurisdictionGeoResponse +from unicourt.model.last_tracked_details import LastTrackedDetails +from unicourt.model.law_firm_analytics_api import LawFirmAnalyticsAPI +from unicourt.model.matched_object import MatchedObject +from unicourt.model.nature_of_suit import NatureOfSuit +from unicourt.model.norm_attorney import NormAttorney +from unicourt.model.norm_attorney_search_response import NormAttorneySearchResponse +from unicourt.model.norm_attorney_search_result import NormAttorneySearchResult +from unicourt.model.norm_corporate_group import NormCorporateGroup +from unicourt.model.norm_judge import NormJudge +from unicourt.model.norm_judge_public_data import NormJudgePublicData +from unicourt.model.norm_judge_public_data_aba_ratings import NormJudgePublicDataAbaRatings +from unicourt.model.norm_judge_public_data_bio import NormJudgePublicDataBio +from unicourt.model.norm_judge_public_data_education_array_inner import NormJudgePublicDataEducationArrayInner +from unicourt.model.norm_judge_public_data_judicial_source import NormJudgePublicDataJudicialSource +from unicourt.model.norm_judge_public_data_name_history_array_inner import NormJudgePublicDataNameHistoryArrayInner +from unicourt.model.norm_judge_search_response import NormJudgeSearchResponse +from unicourt.model.norm_judge_search_result import NormJudgeSearchResult +from unicourt.model.norm_law_firm import NormLawFirm +from unicourt.model.norm_law_firm_search_response import NormLawFirmSearchResponse +from unicourt.model.norm_law_firm_search_result import NormLawFirmSearchResult +from unicourt.model.norm_organization import NormOrganization +from unicourt.model.norm_organization_ticker_array_inner import NormOrganizationTickerArrayInner +from unicourt.model.norm_party import NormParty +from unicourt.model.norm_party_search_response import NormPartySearchResponse +from unicourt.model.norm_party_search_result import NormPartySearchResult +from unicourt.model.pacer_case_search_content import PACERCaseSearchContent +from unicourt.model.pacer_case_search_results import PACERCaseSearchResults +from unicourt.model.pacer_import_case import PACERImportCase +from unicourt.model.pacer_import_case_results import PACERImportCaseResults +from unicourt.model.pacer_party_search_content import PACERPartySearchContent +from unicourt.model.pacer_party_search_results import PACERPartySearchResults +from unicourt.model.pacer_search_page_info import PACERSearchPageInfo +from unicourt.model.pacer_search_receipt import PACERSearchReceipt +from unicourt.model.pcl_case import PCLCase +from unicourt.model.pcl_party import PCLParty +from unicourt.model.pacer_credential import PacerCredential +from unicourt.model.pacer_credential_list_response import PacerCredentialListResponse +from unicourt.model.pacer_credential_request import PacerCredentialRequest +from unicourt.model.parties import Parties +from unicourt.model.party import Party +from unicourt.model.party_analytics_api import PartyAnalyticsAPI +from unicourt.model.party_attorney_association import PartyAttorneyAssociation +from unicourt.model.party_attorney_associations import PartyAttorneyAssociations +from unicourt.model.party_role import PartyRole +from unicourt.model.party_role_group import PartyRoleGroup +from unicourt.model.party_role_group_response import PartyRoleGroupResponse +from unicourt.model.party_role_response import PartyRoleResponse +from unicourt.model.phone import Phone +from unicourt.model.possible_norm_attorney import PossibleNormAttorney +from unicourt.model.possible_norm_attorney_score_constituents import PossibleNormAttorneyScoreConstituents +from unicourt.model.possible_norm_judge import PossibleNormJudge +from unicourt.model.possible_norm_judge_score_constituents import PossibleNormJudgeScoreConstituents +from unicourt.model.possible_norm_law_firm import PossibleNormLawFirm +from unicourt.model.possible_norm_law_firm_score_constituents import PossibleNormLawFirmScoreConstituents +from unicourt.model.possible_norm_law_firm_source_details import PossibleNormLawFirmSourceDetails +from unicourt.model.possible_norm_party import PossibleNormParty +from unicourt.model.possible_norm_party_score_constituents import PossibleNormPartyScoreConstituents +from unicourt.model.preview_document import PreviewDocument +from unicourt.model.raw_ordered_data import RawOrderedData +from unicourt.model.raw_ordered_data_child import RawOrderedDataChild +from unicourt.model.raw_ordered_data_child_child_array_inner import RawOrderedDataChildChildArrayInner +from unicourt.model.referenced_docket_number import ReferencedDocketNumber +from unicourt.model.related_case import RelatedCase +from unicourt.model.related_cases import RelatedCases +from unicourt.model.related_norm_party import RelatedNormParty +from unicourt.model.sos_associated_norm_organization import SOSAssociatedNormOrganization +from unicourt.model.sos_data import SOSData +from unicourt.model.sos_data_preview import SOSDataPreview +from unicourt.model.sos_name_change import SOSNameChange +from unicourt.model.schedule import Schedule +from unicourt.model.service_history import ServiceHistory +from unicourt.model.service_status import ServiceStatus +from unicourt.model.service_status_down_details import ServiceStatusDownDetails +from unicourt.model.similar_norm_attorney import SimilarNormAttorney +from unicourt.model.source_case_data import SourceCaseData +from unicourt.model.source_cause_of_action import SourceCauseOfAction +from unicourt.model.source_charge import SourceCharge +from unicourt.model.source_charge_additional_data import SourceChargeAdditionalData +from unicourt.model.source_page_data import SourcePageData +from unicourt.model.source_structured_data import SourceStructuredData +from unicourt.model.success import Success ACCESS_TOKEN = "" diff --git a/unicourt/api/__init__.py b/unicourt/api/__init__.py index 17b9688..14c16f6 100644 --- a/unicourt/api/__init__.py +++ b/unicourt/api/__init__.py @@ -1,3 +1,22 @@ -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from unicourt.apis import AttorneyAnalyticsApi +# flake8: noqa + +# import apis into api package +from unicourt.api.attorney_analytics_api import AttorneyAnalyticsApi +from unicourt.api.authentication_api import AuthenticationApi +from unicourt.api.callback_api import CallbackApi +from unicourt.api.case_analytics_api import CaseAnalyticsApi +from unicourt.api.case_docket_api import CaseDocketApi +from unicourt.api.case_documents_api import CaseDocumentsApi +from unicourt.api.case_export_api import CaseExportApi +from unicourt.api.case_search_api import CaseSearchApi +from unicourt.api.case_tracking_api import CaseTrackingApi +from unicourt.api.case_update_api import CaseUpdateApi +from unicourt.api.court_availability_api import CourtAvailabilityApi +from unicourt.api.court_standards_api import CourtStandardsApi +from unicourt.api.judge_analytics_api import JudgeAnalyticsApi +from unicourt.api.law_firm_analytics_api import LawFirmAnalyticsApi +from unicourt.api.pacer_api import PACERApi +from unicourt.api.pacer_credential_api import PACERCredentialApi +from unicourt.api.party_analytics_api import PartyAnalyticsApi +from unicourt.api.usage_api import UsageApi + diff --git a/unicourt/api/attorney_analytics_api.py b/unicourt/api/attorney_analytics_api.py index dd0083a..49ee098 100644 --- a/unicourt/api/attorney_analytics_api.py +++ b/unicourt/api/attorney_analytics_api.py @@ -1,958 +1,1759 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated from unicourt.model.associated_norm_judge_response import AssociatedNormJudgeResponse from unicourt.model.associated_norm_law_firm_response import AssociatedNormLawFirmResponse from unicourt.model.associated_norm_party_response import AssociatedNormPartyResponse -from unicourt.model.exception import Exception from unicourt.model.norm_attorney import NormAttorney from unicourt.model.norm_attorney_search_response import NormAttorneySearchResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType + -class AttorneyAnalyticsApi(object): +class AttorneyAnalyticsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_norm_attorney_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (NormAttorney,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normAttorney/{normAttorneyId}', - 'operation_id': 'get_norm_attorney_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_attorney_id', - ], - 'required': [ - 'norm_attorney_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_attorney_id', - ] - }, - root_map={ - 'validations': { - ('norm_attorney_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_attorney_id': - (str,), - }, - 'attribute_map': { - 'norm_attorney_id': 'normAttorneyId', - }, - 'location_map': { - 'norm_attorney_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_norm_judges_associated_with_norm_attorney_endpoint = _Endpoint( - settings={ - 'response_type': (AssociatedNormJudgeResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normAttorney/{normAttorneyId}/associatedNormJudges', - 'operation_id': 'get_norm_judges_associated_with_norm_attorney', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_attorney_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_attorney_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_attorney_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_attorney_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_attorney_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_attorney_id': 'normAttorneyId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_attorney_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_norm_law_firms_associated_with_norm_attorney_endpoint = _Endpoint( - settings={ - 'response_type': (AssociatedNormLawFirmResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normAttorney/{normAttorneyId}/associatedNormLawFirms', - 'operation_id': 'get_norm_law_firms_associated_with_norm_attorney', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_attorney_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_attorney_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_attorney_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_attorney_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_attorney_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_attorney_id': 'normAttorneyId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_attorney_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_norm_parties_associated_with_norm_attorney_endpoint = _Endpoint( - settings={ - 'response_type': (AssociatedNormPartyResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normAttorney/{normAttorneyId}/associatedNormParties', - 'operation_id': 'get_norm_parties_associated_with_norm_attorney', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_attorney_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_attorney_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_attorney_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_attorney_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_attorney_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_attorney_id': 'normAttorneyId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_attorney_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.search_normalized_attorneys_endpoint = _Endpoint( - settings={ - 'response_type': (NormAttorneySearchResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normAttorneySearch', - 'operation_id': 'search_normalized_attorneys', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 1000, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.search_normalized_attorneys_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (NormAttorneySearchResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normAttorneySearch/{normAttorneySearchId}', - 'operation_id': 'search_normalized_attorneys_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_attorney_search_id', - 'page_number', - ], - 'required': [ - 'norm_attorney_search_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_attorney_search_id', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_attorney_search_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('page_number',): { - - 'inclusive_maximum': 1000, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_attorney_search_id': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_attorney_search_id': 'normAttorneySearchId', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_attorney_search_id': 'path', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def get_norm_attorney_by_id( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm ID of Attorney. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NormAttorney: + """Norm Attorney Details. + + This endpoint retrieves information on the attorney in our normalized attorney database which matches the normAttorneyId specified in the request. + + :param norm_attorney_id: Norm ID of Attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_attorney_by_id_serialize( + norm_attorney_id=norm_attorney_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormAttorney", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_attorney_by_id_with_http_info( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm ID of Attorney. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormAttorney]: + """Norm Attorney Details. + + This endpoint retrieves information on the attorney in our normalized attorney database which matches the normAttorneyId specified in the request. + + :param norm_attorney_id: Norm ID of Attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_attorney_by_id_serialize( + norm_attorney_id=norm_attorney_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormAttorney", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_attorney_by_id_without_preload_content( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm ID of Attorney. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Norm Attorney Details. + + This endpoint retrieves information on the attorney in our normalized attorney database which matches the normAttorneyId specified in the request. + + :param norm_attorney_id: Norm ID of Attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_attorney_by_id_serialize( + norm_attorney_id=norm_attorney_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormAttorney", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_attorney_by_id_serialize( self, norm_attorney_id, - **kwargs - ): - """Norm Attorney Details. # noqa: E501 - - This endpoint retrieves information on the attorney in our normalized attorney database which matches the normAttorneyId specified in the request. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_attorney_by_id(norm_attorney_id, async_req=True) - >>> result = thread.get() - - Args: - norm_attorney_id (str): Norm ID of Attorney. - minimum: 18 - maximum: 18 - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NormAttorney - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_attorney_id'] = \ - norm_attorney_id - return self.get_norm_attorney_by_id_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_attorney_id is not None: + _path_params['normAttorneyId'] = norm_attorney_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normAttorney/{normAttorneyId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_norm_judges_associated_with_norm_attorney( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm ID of Attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssociatedNormJudgeResponse: + """Judges faced by the Attorney. + + This endpoint returns information on all judges which have appeared in cases with the attorney specified by the normAttorneyId. The returned judges are ordered in descending order of number of cases shared with the relevant attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: Norm ID of Attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_judges_associated_with_norm_attorney_serialize( + norm_attorney_id=norm_attorney_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormJudgeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_judges_associated_with_norm_attorney_with_http_info( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm ID of Attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormJudgeResponse]: + """Judges faced by the Attorney. + + This endpoint returns information on all judges which have appeared in cases with the attorney specified by the normAttorneyId. The returned judges are ordered in descending order of number of cases shared with the relevant attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: Norm ID of Attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_judges_associated_with_norm_attorney_serialize( + norm_attorney_id=norm_attorney_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormJudgeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_judges_associated_with_norm_attorney_without_preload_content( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm ID of Attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Judges faced by the Attorney. + + This endpoint returns information on all judges which have appeared in cases with the attorney specified by the normAttorneyId. The returned judges are ordered in descending order of number of cases shared with the relevant attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: Norm ID of Attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_judges_associated_with_norm_attorney_serialize( + norm_attorney_id=norm_attorney_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormJudgeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_judges_associated_with_norm_attorney_serialize( self, norm_attorney_id, - **kwargs - ): - """Judges faced by the Attorney. # noqa: E501 - - This endpoint returns information on all judges which have appeared in cases with the attorney specified by the normAttorneyId. The returned judges are ordered in descending order of number of cases shared with the relevant attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

# noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_judges_associated_with_norm_attorney(norm_attorney_id, async_req=True) - >>> result = thread.get() - - Args: - norm_attorney_id (str): Norm ID of Attorney. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AssociatedNormJudgeResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_attorney_id'] = \ - norm_attorney_id - return self.get_norm_judges_associated_with_norm_attorney_endpoint.call_with_http_info(**kwargs) + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_attorney_id is not None: + _path_params['normAttorneyId'] = norm_attorney_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normAttorney/{normAttorneyId}/associatedNormJudges', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_norm_law_firms_associated_with_norm_attorney( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired firms. Keyword expressions should be constructed according to the guidelines shown above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssociatedNormLawFirmResponse: + """Law Firms the attorney has worked for. + + Retrieve law firms with which the specified attorney is known to have been associated. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all LawFirms associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired firms. Keyword expressions should be constructed according to the guidelines shown above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_law_firms_associated_with_norm_attorney_serialize( + norm_attorney_id=norm_attorney_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_law_firms_associated_with_norm_attorney_with_http_info( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired firms. Keyword expressions should be constructed according to the guidelines shown above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormLawFirmResponse]: + """Law Firms the attorney has worked for. + + Retrieve law firms with which the specified attorney is known to have been associated. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all LawFirms associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired firms. Keyword expressions should be constructed according to the guidelines shown above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_law_firms_associated_with_norm_attorney_serialize( + norm_attorney_id=norm_attorney_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_law_firms_associated_with_norm_attorney_without_preload_content( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired firms. Keyword expressions should be constructed according to the guidelines shown above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Law Firms the attorney has worked for. + + Retrieve law firms with which the specified attorney is known to have been associated. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all LawFirms associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired firms. Keyword expressions should be constructed according to the guidelines shown above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_law_firms_associated_with_norm_attorney_serialize( + norm_attorney_id=norm_attorney_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_law_firms_associated_with_norm_attorney_serialize( self, norm_attorney_id, - **kwargs - ): - """Law Firms the attorney has worked for. # noqa: E501 - - Retrieve law firms with which the specified attorney is known to have been associated. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all LawFirms associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

# noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_law_firms_associated_with_norm_attorney(norm_attorney_id, async_req=True) - >>> result = thread.get() - - Args: - norm_attorney_id (str): The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The keyword expression targeting the desired firms. Keyword expressions should be constructed according to the guidelines shown above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AssociatedNormLawFirmResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_attorney_id'] = \ - norm_attorney_id - return self.get_norm_law_firms_associated_with_norm_attorney_endpoint.call_with_http_info(**kwargs) + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_attorney_id is not None: + _path_params['normAttorneyId'] = norm_attorney_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normAttorney/{normAttorneyId}/associatedNormLawFirms', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_norm_parties_associated_with_norm_attorney( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keyword expressions should be constructed according to the guidelines shown above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssociatedNormPartyResponse: + """Parties Represented By the Attorney. + + Retrieve the parties for which an attorney is known to have represented.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object.. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired parties. Keyword expressions should be constructed according to the guidelines shown above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_parties_associated_with_norm_attorney_serialize( + norm_attorney_id=norm_attorney_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_parties_associated_with_norm_attorney_with_http_info( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keyword expressions should be constructed according to the guidelines shown above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormPartyResponse]: + """Parties Represented By the Attorney. + + Retrieve the parties for which an attorney is known to have represented.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object.. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired parties. Keyword expressions should be constructed according to the guidelines shown above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_parties_associated_with_norm_attorney_serialize( + norm_attorney_id=norm_attorney_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_parties_associated_with_norm_attorney_without_preload_content( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keyword expressions should be constructed according to the guidelines shown above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Parties Represented By the Attorney. + + Retrieve the parties for which an attorney is known to have represented.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object.. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired parties. Keyword expressions should be constructed according to the guidelines shown above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_parties_associated_with_norm_attorney_serialize( + norm_attorney_id=norm_attorney_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_parties_associated_with_norm_attorney_serialize( self, norm_attorney_id, - **kwargs - ): - """Parties Represented By the Attorney. # noqa: E501 - - Retrieve the parties for which an attorney is known to have represented.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object.. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

# noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_parties_associated_with_norm_attorney(norm_attorney_id, async_req=True) - >>> result = thread.get() - - Args: - norm_attorney_id (str): The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The keyword expression targeting the desired parties. Keyword expressions should be constructed according to the guidelines shown above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AssociatedNormPartyResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_attorney_id'] = \ - norm_attorney_id - return self.get_norm_parties_associated_with_norm_attorney_endpoint.call_with_http_info(**kwargs) + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_attorney_id is not None: + _path_params['normAttorneyId'] = norm_attorney_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normAttorney/{normAttorneyId}/associatedNormParties', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def search_normalized_attorneys( self, - **kwargs - ): - """Attorney search. # noqa: E501 - - ### This endpoint retrieves information, including the normAttorneyId, on all attorneys in our normalized attorney database which match the request parameters. All query parameters supported by this API can be found in the schema section below. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.search_normalized_attorneys(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. . [optional] - page_number (int): The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NormAttorneySearchResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.search_normalized_attorneys_endpoint.call_with_http_info(**kwargs) + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NormAttorneySearchResponse: + """Attorney search. + + ### This endpoint retrieves information, including the normAttorneyId, on all attorneys in our normalized attorney database which match the request parameters. All query parameters supported by this API can be found in the schema section below. + + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_attorneys_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormAttorneySearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def search_normalized_attorneys_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormAttorneySearchResponse]: + """Attorney search. + + ### This endpoint retrieves information, including the normAttorneyId, on all attorneys in our normalized attorney database which match the request parameters. All query parameters supported by this API can be found in the schema section below. + + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_attorneys_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormAttorneySearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def search_normalized_attorneys_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Attorney search. + + ### This endpoint retrieves information, including the normAttorneyId, on all attorneys in our normalized attorney database which match the request parameters. All query parameters supported by this API can be found in the schema section below. + + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_attorneys_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormAttorneySearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _search_normalized_attorneys_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normAttorneySearch', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def search_normalized_attorneys_by_id( + self, + norm_attorney_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm Attorney Search information for the given normAttorneySearchId.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NormAttorneySearchResponse: + """Norm attorney search results for a given normAttorneySearchId. + + ### All query parameters supported for this API can be found in below schema section. Schema --> NormAttorneySearchQueryObject + + :param norm_attorney_search_id: Norm Attorney Search information for the given normAttorneySearchId. (required) + :type norm_attorney_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_attorneys_by_id_serialize( + norm_attorney_search_id=norm_attorney_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormAttorneySearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def search_normalized_attorneys_by_id_with_http_info( + self, + norm_attorney_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm Attorney Search information for the given normAttorneySearchId.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormAttorneySearchResponse]: + """Norm attorney search results for a given normAttorneySearchId. + + ### All query parameters supported for this API can be found in below schema section. Schema --> NormAttorneySearchQueryObject + + :param norm_attorney_search_id: Norm Attorney Search information for the given normAttorneySearchId. (required) + :type norm_attorney_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_attorneys_by_id_serialize( + norm_attorney_search_id=norm_attorney_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormAttorneySearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def search_normalized_attorneys_by_id_without_preload_content( + self, + norm_attorney_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm Attorney Search information for the given normAttorneySearchId.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Norm attorney search results for a given normAttorneySearchId. + + ### All query parameters supported for this API can be found in below schema section. Schema --> NormAttorneySearchQueryObject + + :param norm_attorney_search_id: Norm Attorney Search information for the given normAttorneySearchId. (required) + :type norm_attorney_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_attorneys_by_id_serialize( + norm_attorney_search_id=norm_attorney_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormAttorneySearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _search_normalized_attorneys_by_id_serialize( self, norm_attorney_search_id, - **kwargs - ): - """Norm attorney search results for a given normAttorneySearchId. # noqa: E501 - - ### All query parameters supported for this API can be found in below schema section. Schema --> NormAttorneySearchQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.search_normalized_attorneys_by_id(norm_attorney_search_id, async_req=True) - >>> result = thread.get() - - Args: - norm_attorney_search_id (str): Norm Attorney Search information for the given normAttorneySearchId. - - Keyword Args: - page_number (int): The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NormAttorneySearchResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_attorney_search_id'] = \ - norm_attorney_search_id - return self.search_normalized_attorneys_by_id_endpoint.call_with_http_info(**kwargs) + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_attorney_search_id is not None: + _path_params['normAttorneySearchId'] = norm_attorney_search_id + # process the query parameters + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normAttorneySearch/{normAttorneySearchId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + diff --git a/unicourt/api/authentication_api.py b/unicourt/api/authentication_api.py index 35cf4b8..74a8671 100644 --- a/unicourt/api/authentication_api.py +++ b/unicourt/api/authentication_api.py @@ -1,551 +1,1138 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated from unicourt.model.access_token_id_list_response import AccessTokenIdListResponse from unicourt.model.access_token_request import AccessTokenRequest from unicourt.model.access_token_response import AccessTokenResponse -from unicourt.model.exception import Exception from unicourt.model.invalidate_access_token_request import InvalidateAccessTokenRequest from unicourt.model.success import Success +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType -class AuthenticationApi(object): + +class AuthenticationApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.generate_new_token_endpoint = _Endpoint( - settings={ - 'response_type': (AccessTokenResponse,), - 'auth': [], - 'endpoint_path': '/generateNewToken', - 'operation_id': 'generate_new_token', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'access_token_request', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'access_token_request': - (AccessTokenRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'access_token_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.invalidate_all_tokens_endpoint = _Endpoint( - settings={ - 'response_type': (Success,), - 'auth': [], - 'endpoint_path': '/invalidateAllTokens', - 'operation_id': 'invalidate_all_tokens', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'access_token_request', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'access_token_request': - (AccessTokenRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'access_token_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.invalidate_token_endpoint = _Endpoint( - settings={ - 'response_type': (Success,), - 'auth': [], - 'endpoint_path': '/invalidateToken', - 'operation_id': 'invalidate_token', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'invalidate_access_token_request', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'invalidate_access_token_request': - (InvalidateAccessTokenRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'invalidate_access_token_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.list_all_token_ids_endpoint = _Endpoint( - settings={ - 'response_type': (AccessTokenIdListResponse,), - 'auth': [], - 'endpoint_path': '/listAllTokenIds', - 'operation_id': 'list_all_token_ids', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'access_token_request', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'access_token_request': - (AccessTokenRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'access_token_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def generate_new_token( self, - **kwargs - ): - """Generate new token to access API. # noqa: E501 - - This endpoint allows you to generate a new access token, which is a required field for all UniCourt API endpoints except for the Authentication API. To generate a new token, you must provide your Client ID and Client Secret ID which you can find by logging into your UniCourt account. At any time, you can have a maximum of 10 active access tokens. The tokens never expire and, if you make a request which would otherwise lead to you having more than 10 active tokens, you will receive an error message. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.generate_new_token(async_req=True) - >>> result = thread.get() - - - Keyword Args: - access_token_request (AccessTokenRequest): The endpoint accepts your Client ID and Client Secret ID as part of the request.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AccessTokenResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.generate_new_token_endpoint.call_with_http_info(**kwargs) + access_token_request: Annotated[Optional[AccessTokenRequest], Field(description="The endpoint accepts your Client ID and Client Secret ID as part of the request.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AccessTokenResponse: + """Generate new token to access API. + + This endpoint allows you to generate a new access token, which is a required field for all UniCourt API endpoints except for the Authentication API. To generate a new token, you must provide your Client ID and Client Secret ID which you can find by logging into your UniCourt account. At any time, you can have a maximum of 10 active access tokens. The tokens never expire and, if you make a request which would otherwise lead to you having more than 10 active tokens, you will receive an error message. + + :param access_token_request: The endpoint accepts your Client ID and Client Secret ID as part of the request. + :type access_token_request: AccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_new_token_serialize( + access_token_request=access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccessTokenResponse", + '400': "Exception", + '403': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def generate_new_token_with_http_info( + self, + access_token_request: Annotated[Optional[AccessTokenRequest], Field(description="The endpoint accepts your Client ID and Client Secret ID as part of the request.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AccessTokenResponse]: + """Generate new token to access API. + + This endpoint allows you to generate a new access token, which is a required field for all UniCourt API endpoints except for the Authentication API. To generate a new token, you must provide your Client ID and Client Secret ID which you can find by logging into your UniCourt account. At any time, you can have a maximum of 10 active access tokens. The tokens never expire and, if you make a request which would otherwise lead to you having more than 10 active tokens, you will receive an error message. + + :param access_token_request: The endpoint accepts your Client ID and Client Secret ID as part of the request. + :type access_token_request: AccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_new_token_serialize( + access_token_request=access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccessTokenResponse", + '400': "Exception", + '403': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def generate_new_token_without_preload_content( + self, + access_token_request: Annotated[Optional[AccessTokenRequest], Field(description="The endpoint accepts your Client ID and Client Secret ID as part of the request.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Generate new token to access API. + + This endpoint allows you to generate a new access token, which is a required field for all UniCourt API endpoints except for the Authentication API. To generate a new token, you must provide your Client ID and Client Secret ID which you can find by logging into your UniCourt account. At any time, you can have a maximum of 10 active access tokens. The tokens never expire and, if you make a request which would otherwise lead to you having more than 10 active tokens, you will receive an error message. + + :param access_token_request: The endpoint accepts your Client ID and Client Secret ID as part of the request. + :type access_token_request: AccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_new_token_serialize( + access_token_request=access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccessTokenResponse", + '400': "Exception", + '403': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _generate_new_token_serialize( + self, + access_token_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if access_token_request is not None: + _body_params = access_token_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + return self.api_client.param_serialize( + method='POST', + resource_path='/generateNewToken', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def invalidate_all_tokens( self, - **kwargs - ): - """API to invalidate all access tokens. # noqa: E501 - - An endpoint which allows you to invalidate all existing access tokens associated with your UniCourt account. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.invalidate_all_tokens(async_req=True) - >>> result = thread.get() - - - Keyword Args: - access_token_request (AccessTokenRequest): The endpoint accepts your Client ID and Secret Client ID as part of the request.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Success - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.invalidate_all_tokens_endpoint.call_with_http_info(**kwargs) + access_token_request: Annotated[Optional[AccessTokenRequest], Field(description="The endpoint accepts your Client ID and Secret Client ID as part of the request.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Success: + """API to invalidate all access tokens. + + An endpoint which allows you to invalidate all existing access tokens associated with your UniCourt account. + + :param access_token_request: The endpoint accepts your Client ID and Secret Client ID as part of the request. + :type access_token_request: AccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._invalidate_all_tokens_serialize( + access_token_request=access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def invalidate_all_tokens_with_http_info( + self, + access_token_request: Annotated[Optional[AccessTokenRequest], Field(description="The endpoint accepts your Client ID and Secret Client ID as part of the request.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Success]: + """API to invalidate all access tokens. + + An endpoint which allows you to invalidate all existing access tokens associated with your UniCourt account. + + :param access_token_request: The endpoint accepts your Client ID and Secret Client ID as part of the request. + :type access_token_request: AccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._invalidate_all_tokens_serialize( + access_token_request=access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def invalidate_all_tokens_without_preload_content( + self, + access_token_request: Annotated[Optional[AccessTokenRequest], Field(description="The endpoint accepts your Client ID and Secret Client ID as part of the request.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """API to invalidate all access tokens. + + An endpoint which allows you to invalidate all existing access tokens associated with your UniCourt account. + + :param access_token_request: The endpoint accepts your Client ID and Secret Client ID as part of the request. + :type access_token_request: AccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._invalidate_all_tokens_serialize( + access_token_request=access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _invalidate_all_tokens_serialize( + self, + access_token_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if access_token_request is not None: + _body_params = access_token_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/invalidateAllTokens', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def invalidate_token( self, - **kwargs - ): - """API to invalidate the access token. # noqa: E501 - - An endpoint which allows you to invalidate a given access token. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.invalidate_token(async_req=True) - >>> result = thread.get() - - - Keyword Args: - invalidate_access_token_request (InvalidateAccessTokenRequest): The endpoint accepts your Client ID, Client Secret ID and the Token ID for the access token you wish to invalidate as part of the request. You can obtain a list of all Token IDs from the /listAllTokenIds endpoint within this API.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Success - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.invalidate_token_endpoint.call_with_http_info(**kwargs) + invalidate_access_token_request: Annotated[Optional[InvalidateAccessTokenRequest], Field(description="The endpoint accepts your Client ID, Client Secret ID and the Token ID for the access token you wish to invalidate as part of the request. You can obtain a list of all Token IDs from the /listAllTokenIds endpoint within this API.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Success: + """API to invalidate the access token. + + An endpoint which allows you to invalidate a given access token. + + :param invalidate_access_token_request: The endpoint accepts your Client ID, Client Secret ID and the Token ID for the access token you wish to invalidate as part of the request. You can obtain a list of all Token IDs from the /listAllTokenIds endpoint within this API. + :type invalidate_access_token_request: InvalidateAccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._invalidate_token_serialize( + invalidate_access_token_request=invalidate_access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def invalidate_token_with_http_info( + self, + invalidate_access_token_request: Annotated[Optional[InvalidateAccessTokenRequest], Field(description="The endpoint accepts your Client ID, Client Secret ID and the Token ID for the access token you wish to invalidate as part of the request. You can obtain a list of all Token IDs from the /listAllTokenIds endpoint within this API.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Success]: + """API to invalidate the access token. + + An endpoint which allows you to invalidate a given access token. + + :param invalidate_access_token_request: The endpoint accepts your Client ID, Client Secret ID and the Token ID for the access token you wish to invalidate as part of the request. You can obtain a list of all Token IDs from the /listAllTokenIds endpoint within this API. + :type invalidate_access_token_request: InvalidateAccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._invalidate_token_serialize( + invalidate_access_token_request=invalidate_access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def invalidate_token_without_preload_content( + self, + invalidate_access_token_request: Annotated[Optional[InvalidateAccessTokenRequest], Field(description="The endpoint accepts your Client ID, Client Secret ID and the Token ID for the access token you wish to invalidate as part of the request. You can obtain a list of all Token IDs from the /listAllTokenIds endpoint within this API.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """API to invalidate the access token. + + An endpoint which allows you to invalidate a given access token. + + :param invalidate_access_token_request: The endpoint accepts your Client ID, Client Secret ID and the Token ID for the access token you wish to invalidate as part of the request. You can obtain a list of all Token IDs from the /listAllTokenIds endpoint within this API. + :type invalidate_access_token_request: InvalidateAccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._invalidate_token_serialize( + invalidate_access_token_request=invalidate_access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _invalidate_token_serialize( + self, + invalidate_access_token_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if invalidate_access_token_request is not None: + _body_params = invalidate_access_token_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/invalidateToken', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def list_all_token_ids( self, - **kwargs - ): - """API to list all the access tokens Id. # noqa: E501 - - An endpoint which allows you to view all active access tokens associated with your Client ID and Client Secret ID. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_all_token_ids(async_req=True) - >>> result = thread.get() - - - Keyword Args: - access_token_request (AccessTokenRequest): The endpoint accepts your Client ID and Client Secret ID as part of the request.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AccessTokenIdListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.list_all_token_ids_endpoint.call_with_http_info(**kwargs) + access_token_request: Annotated[Optional[AccessTokenRequest], Field(description="The endpoint accepts your Client ID and Client Secret ID as part of the request.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AccessTokenIdListResponse: + """API to list all the access tokens Id. + + An endpoint which allows you to view all active access tokens associated with your Client ID and Client Secret ID. + + :param access_token_request: The endpoint accepts your Client ID and Client Secret ID as part of the request. + :type access_token_request: AccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_all_token_ids_serialize( + access_token_request=access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccessTokenIdListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_all_token_ids_with_http_info( + self, + access_token_request: Annotated[Optional[AccessTokenRequest], Field(description="The endpoint accepts your Client ID and Client Secret ID as part of the request.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AccessTokenIdListResponse]: + """API to list all the access tokens Id. + + An endpoint which allows you to view all active access tokens associated with your Client ID and Client Secret ID. + + :param access_token_request: The endpoint accepts your Client ID and Client Secret ID as part of the request. + :type access_token_request: AccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_all_token_ids_serialize( + access_token_request=access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccessTokenIdListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_all_token_ids_without_preload_content( + self, + access_token_request: Annotated[Optional[AccessTokenRequest], Field(description="The endpoint accepts your Client ID and Client Secret ID as part of the request.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """API to list all the access tokens Id. + + An endpoint which allows you to view all active access tokens associated with your Client ID and Client Secret ID. + + :param access_token_request: The endpoint accepts your Client ID and Client Secret ID as part of the request. + :type access_token_request: AccessTokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_all_token_ids_serialize( + access_token_request=access_token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AccessTokenIdListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_all_token_ids_serialize( + self, + access_token_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if access_token_request is not None: + _body_params = access_token_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/listAllTokenIds', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + diff --git a/unicourt/api/callback_api.py b/unicourt/api/callback_api.py index 649a6f7..58baf74 100644 --- a/unicourt/api/callback_api.py +++ b/unicourt/api/callback_api.py @@ -1,190 +1,327 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from datetime import datetime +from pydantic import Field, field_validator +from typing import Optional +from typing_extensions import Annotated from unicourt.model.callback_list_response import CallbackListResponse -from unicourt.model.exception import Exception +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType -class CallbackApi(object): + +class CallbackApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_callbacks_endpoint = _Endpoint( - settings={ - 'response_type': (CallbackListResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/callbacks', - 'operation_id': 'get_callbacks', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'date', - 'status', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'status', - ], - 'validation': [ - 'date', - 'status', - ] - }, - root_map={ - 'validations': { - ('date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('status',): { - 'max_length': 11, - 'min_length': 7, - }, - }, - 'allowed_values': { - ('status',): { - - "IN_PROGRESS": "IN_PROGRESS", - "COMPLETE": "COMPLETE", - "FAILURE": "FAILURE" - }, - }, - 'openapi_types': { - 'date': - (datetime,), - 'status': - (str,), - }, - 'attribute_map': { - 'date': 'date', - 'status': 'status', - }, - 'location_map': { - 'date': 'query', - 'status': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def get_callbacks( self, - **kwargs - ): - """Get list of callback types with count for a requested Date. # noqa: E501 - - Get list of callback types with count for a requested Date. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_callbacks(async_req=True) - >>> result = thread.get() - - - Keyword Args: - date (datetime): Date for which fetch the callback type list. By default, the date will be set to current date.. [optional] - status (str): Status of the callbacks. Default status will fetch all callbacks.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CallbackListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + date: Annotated[Optional[datetime], Field(description="Date for which fetch the callback type list. By default, the date will be set to current date.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of the callbacks. Default status will fetch all callbacks.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CallbackListResponse: + """Get list of callback types with count for a requested Date. + + Get list of callback types with count for a requested Date. + + :param date: Date for which fetch the callback type list. By default, the date will be set to current date. + :type date: datetime + :param status: Status of the callbacks. Default status will fetch all callbacks. + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_callbacks_serialize( + date=date, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CallbackListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_callbacks_with_http_info( + self, + date: Annotated[Optional[datetime], Field(description="Date for which fetch the callback type list. By default, the date will be set to current date.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of the callbacks. Default status will fetch all callbacks.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CallbackListResponse]: + """Get list of callback types with count for a requested Date. + + Get list of callback types with count for a requested Date. + + :param date: Date for which fetch the callback type list. By default, the date will be set to current date. + :type date: datetime + :param status: Status of the callbacks. Default status will fetch all callbacks. + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_callbacks_serialize( + date=date, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CallbackListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def get_callbacks_without_preload_content( + self, + date: Annotated[Optional[datetime], Field(description="Date for which fetch the callback type list. By default, the date will be set to current date.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of the callbacks. Default status will fetch all callbacks.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get list of callback types with count for a requested Date. + + Get list of callback types with count for a requested Date. + + :param date: Date for which fetch the callback type list. By default, the date will be set to current date. + :type date: datetime + :param status: Status of the callbacks. Default status will fetch all callbacks. + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_callbacks_serialize( + date=date, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CallbackListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_callbacks_endpoint.call_with_http_info(**kwargs) + return response_data.response + + + def _get_callbacks_serialize( + self, + date, + status, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if date is not None: + if isinstance(date, datetime): + _query_params.append( + ( + 'date', + date + ) + ) + else: + _query_params.append(('date', date)) + + if status is not None: + + _query_params.append(('status', status)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/callbacks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + diff --git a/unicourt/api/case_analytics_api.py b/unicourt/api/case_analytics_api.py index 72a7289..7b55d6a 100644 --- a/unicourt/api/case_analytics_api.py +++ b/unicourt/api/case_analytics_api.py @@ -1,26 +1,24 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated from unicourt.model.case_count_analytics_by_area_of_law_response import CaseCountAnalyticsByAreaOfLawResponse from unicourt.model.case_count_analytics_by_case_class_response import CaseCountAnalyticsByCaseClassResponse from unicourt.model.case_count_analytics_by_case_filed_date_response import CaseCountAnalyticsByCaseFiledDateResponse @@ -37,2806 +35,5459 @@ from unicourt.model.case_count_analytics_by_norm_party_response import CaseCountAnalyticsByNormPartyResponse from unicourt.model.case_count_analytics_by_party_role_group_response import CaseCountAnalyticsByPartyRoleGroupResponse from unicourt.model.case_count_analytics_by_party_role_response import CaseCountAnalyticsByPartyRoleResponse -from unicourt.model.exception import Exception +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType -class CaseAnalyticsApi(object): + +class CaseAnalyticsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_case_count_analytics_by_area_of_law_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByAreaOfLawResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByAreaOfLaw', - 'operation_id': 'get_case_count_analytics_by_area_of_law', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_case_class_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByCaseClassResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByCaseClass', - 'operation_id': 'get_case_count_analytics_by_case_class', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_case_filed_date_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByCaseFiledDateResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByCaseFiledDate', - 'operation_id': 'get_case_count_analytics_by_case_filed_date', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'group_by', - 'q', - 'page_number', - ], - 'required': [ - 'group_by', - ], - 'nullable': [ - ], - 'enum': [ - 'group_by', - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - ('group_by',): { - - "YEARLY": "Yearly", - "QUARTERLY": "Quarterly", - "MONTHLY": "Monthly", - "WEEKLY": "Weekly" - }, - }, - 'openapi_types': { - 'group_by': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'group_by': 'groupBy', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'group_by': 'query', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_case_type_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByCaseTypeResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByCaseType', - 'operation_id': 'get_case_count_analytics_by_case_type', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_case_type_group_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByCaseTypeGroupResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByCaseTypeGroup', - 'operation_id': 'get_case_count_analytics_by_case_type_group', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_court_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByCourtResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByCourt', - 'operation_id': 'get_case_count_analytics_by_court', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_court_location_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByCourtLocationResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByCourtLocation', - 'operation_id': 'get_case_count_analytics_by_court_location', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_court_system_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByCourtSystemResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByCourtSystem', - 'operation_id': 'get_case_count_analytics_by_court_system', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_court_type_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByCourtTypeResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByCourtType', - 'operation_id': 'get_case_count_analytics_by_court_type', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_jurisdiction_geo_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByJurisdictionGeoResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByJurisdictionGeo', - 'operation_id': 'get_case_count_analytics_by_jurisdiction_geo', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_norm_attorney_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByNormAttorneyResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByNormAttorney', - 'operation_id': 'get_case_count_analytics_by_norm_attorney', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_norm_judge_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByNormJudgeResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByNormJudge', - 'operation_id': 'get_case_count_analytics_by_norm_judge', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_norm_law_firm_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByNormLawFirmResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByNormLawFirm', - 'operation_id': 'get_case_count_analytics_by_norm_law_firm', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_norm_party_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByNormPartyResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByNormParty', - 'operation_id': 'get_case_count_analytics_by_norm_party', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByNormAttorneyResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normAttorney/{normAttorneyId}/caseCountAnalyticsByOpposingNormAttorney', - 'operation_id': 'get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_attorney_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_attorney_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_attorney_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_attorney_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_attorney_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_attorney_id': 'normAttorneyId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_attorney_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByNormLawFirmResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normLawFirm/{normLawFirmId}/caseCountAnalyticsByOpposingNormLawFirm', - 'operation_id': 'get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_law_firm_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_law_firm_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_law_firm_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_law_firm_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_law_firm_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_law_firm_id': 'normLawFirmId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_law_firm_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_opposing_norm_party_for_a_norm_party_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByNormPartyResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normParty/{normPartyId}/caseCountAnalyticsByOpposingNormParty', - 'operation_id': 'get_case_count_analytics_by_opposing_norm_party_for_a_norm_party', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_party_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_party_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_party_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_party_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_party_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_party_id': 'normPartyId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_party_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_party_role_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByPartyRoleResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByPartyRole', - 'operation_id': 'get_case_count_analytics_by_party_role', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_count_analytics_by_party_role_group_endpoint = _Endpoint( - settings={ - 'response_type': (CaseCountAnalyticsByPartyRoleGroupResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseCountAnalyticsByPartyRoleGroup', - 'operation_id': 'get_case_count_analytics_by_party_role_group', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def get_case_count_analytics_by_area_of_law( self, - **kwargs - ): - """Case Count Analytics by Area Of Law. # noqa: E501 - - Retrieve case counts by area of law. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Area Of Law of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_area_of_law(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByAreaOfLawResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_area_of_law_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByAreaOfLawResponse: + """Case Count Analytics by Area Of Law. + + Retrieve case counts by area of law. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Area Of Law of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_area_of_law_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByAreaOfLawResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_area_of_law_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByAreaOfLawResponse]: + """Case Count Analytics by Area Of Law. + + Retrieve case counts by area of law. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Area Of Law of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_area_of_law_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByAreaOfLawResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_area_of_law_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Area Of Law. + + Retrieve case counts by area of law. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Area Of Law of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_area_of_law_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByAreaOfLawResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_area_of_law_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByAreaOfLaw', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_case_class( self, - **kwargs - ): - """Case Count Analytics by Case Class. # noqa: E501 - - Retrieve case counts by case class. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Case Class of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_case_class(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByCaseClassResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_case_class_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByCaseClassResponse: + """Case Count Analytics by Case Class. + + Retrieve case counts by case class. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Case Class of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_case_class_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCaseClassResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_case_class_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCaseClassResponse]: + """Case Count Analytics by Case Class. + + Retrieve case counts by case class. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Case Class of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_case_class_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCaseClassResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_case_class_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Case Class. + + Retrieve case counts by case class. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Case Class of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_case_class_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCaseClassResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_case_class_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByCaseClass', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_case_filed_date( + self, + group_by: Annotated[StrictStr, Field(description="GroupBy")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByCaseFiledDateResponse: + """Case Count Analytics by Case Filed Date. + + Retrieve case count analytics by filing date. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case filed date of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param group_by: GroupBy (required) + :type group_by: str + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_case_filed_date_serialize( + group_by=group_by, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCaseFiledDateResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_case_filed_date_with_http_info( + self, + group_by: Annotated[StrictStr, Field(description="GroupBy")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCaseFiledDateResponse]: + """Case Count Analytics by Case Filed Date. + + Retrieve case count analytics by filing date. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case filed date of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param group_by: GroupBy (required) + :type group_by: str + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_case_filed_date_serialize( + group_by=group_by, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCaseFiledDateResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_case_filed_date_without_preload_content( + self, + group_by: Annotated[StrictStr, Field(description="GroupBy")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Case Filed Date. + + Retrieve case count analytics by filing date. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case filed date of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param group_by: GroupBy (required) + :type group_by: str + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_case_filed_date_serialize( + group_by=group_by, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCaseFiledDateResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_case_filed_date_serialize( self, group_by, - **kwargs - ): - """Case Count Analytics by Case Filed Date. # noqa: E501 - - Retrieve case count analytics by filing date. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case filed date of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_case_filed_date(group_by, async_req=True) - >>> result = thread.get() - - Args: - group_by (str): GroupBy - - Keyword Args: - q (str): The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByCaseFiledDateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['group_by'] = \ - group_by - return self.get_case_count_analytics_by_case_filed_date_endpoint.call_with_http_info(**kwargs) - + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if group_by is not None: + + _query_params.append(('groupBy', group_by)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByCaseFiledDate', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_case_type( self, - **kwargs - ): - """Case Count Analytics by Case Type. # noqa: E501 - - Retrieve case counts by case type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case types of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_case_type(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByCaseTypeResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_case_type_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByCaseTypeResponse: + """Case Count Analytics by Case Type. + + Retrieve case counts by case type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case types of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_case_type_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCaseTypeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_case_type_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCaseTypeResponse]: + """Case Count Analytics by Case Type. + + Retrieve case counts by case type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case types of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_case_type_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCaseTypeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_case_type_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Case Type. + + Retrieve case counts by case type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case types of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_case_type_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCaseTypeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_case_type_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByCaseType', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_case_type_group( self, - **kwargs - ): - """Case Count Analytics by Case Type Group. # noqa: E501 - - Retrieve case counts by case type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case type catgeory of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_case_type_group(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByCaseTypeGroupResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_case_type_group_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByCaseTypeGroupResponse: + """Case Count Analytics by Case Type Group. + + Retrieve case counts by case type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case type catgeory of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_case_type_group_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCaseTypeGroupResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_case_type_group_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCaseTypeGroupResponse]: + """Case Count Analytics by Case Type Group. + + Retrieve case counts by case type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case type catgeory of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_case_type_group_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCaseTypeGroupResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_case_type_group_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Case Type Group. + + Retrieve case counts by case type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case type catgeory of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_case_type_group_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCaseTypeGroupResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_case_type_group_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByCaseTypeGroup', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_court( self, - **kwargs - ): - """Case Count Analytics by Court. # noqa: E501 - - Retrieve case counts by court. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Court of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_court(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByCourtResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_court_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByCourtResponse: + """Case Count Analytics by Court. + + Retrieve case counts by court. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Court of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_court_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCourtResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_court_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCourtResponse]: + """Case Count Analytics by Court. + + Retrieve case counts by court. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Court of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_court_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCourtResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_court_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Court. + + Retrieve case counts by court. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Court of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_court_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCourtResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_court_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByCourt', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_court_location( self, - **kwargs - ): - """Case Count Analytics by Court Location. # noqa: E501 - - Retrieve case counts by court location. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court location of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_court_location(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByCourtLocationResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_court_location_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByCourtLocationResponse: + """Case Count Analytics by Court Location. + + Retrieve case counts by court location. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court location of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_court_location_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCourtLocationResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_court_location_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCourtLocationResponse]: + """Case Count Analytics by Court Location. + + Retrieve case counts by court location. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court location of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_court_location_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCourtLocationResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_court_location_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Court Location. + + Retrieve case counts by court location. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court location of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_court_location_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCourtLocationResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_court_location_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByCourtLocation', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_court_system( self, - **kwargs - ): - """Case Count Analytics by Court System. # noqa: E501 - - Retrieve case counts by court system. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court system of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_court_system(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByCourtSystemResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_court_system_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByCourtSystemResponse: + """Case Count Analytics by Court System. + + Retrieve case counts by court system. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court system of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_court_system_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCourtSystemResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_court_system_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCourtSystemResponse]: + """Case Count Analytics by Court System. + + Retrieve case counts by court system. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court system of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_court_system_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCourtSystemResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_court_system_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Court System. + + Retrieve case counts by court system. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court system of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_court_system_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCourtSystemResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_court_system_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByCourtSystem', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_court_type( self, - **kwargs - ): - """Case Count Analytics by CourtType. # noqa: E501 - - Retrieve case counts by court type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court type of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_court_type(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByCourtTypeResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_court_type_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByCourtTypeResponse: + """Case Count Analytics by CourtType. + + Retrieve case counts by court type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court type of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_court_type_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCourtTypeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_court_type_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCourtTypeResponse]: + """Case Count Analytics by CourtType. + + Retrieve case counts by court type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court type of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_court_type_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCourtTypeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_court_type_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by CourtType. + + Retrieve case counts by court type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court type of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_court_type_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByCourtTypeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_court_type_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByCourtType', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_jurisdiction_geo( self, - **kwargs - ): - """Case Count Analytics by Jurisdiction Geo. # noqa: E501 - - Retrieve case counts by jurisdiction geography. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by jurisdiction geo of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_jurisdiction_geo(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByJurisdictionGeoResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_jurisdiction_geo_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByJurisdictionGeoResponse: + """Case Count Analytics by Jurisdiction Geo. + + Retrieve case counts by jurisdiction geography. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by jurisdiction geo of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_jurisdiction_geo_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByJurisdictionGeoResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_jurisdiction_geo_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByJurisdictionGeoResponse]: + """Case Count Analytics by Jurisdiction Geo. + + Retrieve case counts by jurisdiction geography. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by jurisdiction geo of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_jurisdiction_geo_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByJurisdictionGeoResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_jurisdiction_geo_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Jurisdiction Geo. + + Retrieve case counts by jurisdiction geography. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by jurisdiction geo of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_jurisdiction_geo_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByJurisdictionGeoResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_jurisdiction_geo_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByJurisdictionGeo', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_norm_attorney( self, - **kwargs - ): - """Case Count Analytics by Attorney. # noqa: E501 - - Retrieve case counts for the specified attorneys. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_norm_attorney(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired attorneys.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByNormAttorneyResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_norm_attorney_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByNormAttorneyResponse: + """Case Count Analytics by Attorney. + + Retrieve case counts for the specified attorneys. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_norm_attorney_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_norm_attorney_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByNormAttorneyResponse]: + """Case Count Analytics by Attorney. + + Retrieve case counts for the specified attorneys. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_norm_attorney_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_norm_attorney_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Attorney. + + Retrieve case counts for the specified attorneys. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_norm_attorney_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_norm_attorney_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByNormAttorney', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_norm_judge( self, - **kwargs - ): - """Case Count Analytics by Judge. # noqa: E501 - - Retrieve case counts for judges. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm judge of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_norm_judge(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByNormJudgeResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_norm_judge_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByNormJudgeResponse: + """Case Count Analytics by Judge. + + Retrieve case counts for judges. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm judge of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_norm_judge_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormJudgeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_norm_judge_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByNormJudgeResponse]: + """Case Count Analytics by Judge. + + Retrieve case counts for judges. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm judge of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_norm_judge_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormJudgeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_norm_judge_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Judge. + + Retrieve case counts for judges. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm judge of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_norm_judge_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormJudgeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_norm_judge_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByNormJudge', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_norm_law_firm( self, - **kwargs - ): - """Case Count Analytics by Norm Law Firm. # noqa: E501 - - Returns Case Analytics by Norm Law Firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_norm_law_firm(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByNormLawFirmResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_norm_law_firm_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByNormLawFirmResponse: + """Case Count Analytics by Norm Law Firm. + + Returns Case Analytics by Norm Law Firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_norm_law_firm_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_norm_law_firm_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByNormLawFirmResponse]: + """Case Count Analytics by Norm Law Firm. + + Returns Case Analytics by Norm Law Firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_norm_law_firm_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_norm_law_firm_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Norm Law Firm. + + Returns Case Analytics by Norm Law Firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_norm_law_firm_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_norm_law_firm_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByNormLawFirm', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_norm_party( self, - **kwargs - ): - """Case Count Analytics by Party. # noqa: E501 - - Retrieve case counts for parties. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_norm_party(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByNormPartyResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_norm_party_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByNormPartyResponse: + """Case Count Analytics by Party. + + Retrieve case counts for parties. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_norm_party_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_norm_party_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByNormPartyResponse]: + """Case Count Analytics by Party. + + Retrieve case counts for parties. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_norm_party_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_norm_party_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Party. + + Retrieve case counts for parties. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_norm_party_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_norm_party_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByNormParty', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the attorney for whom opposing-counsel attorneys are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired opposing counsel attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByNormAttorneyResponse: + """Case Count Analytics by Opposing Norm Attorney. + + Retrieve case counts for attorneys who have appeared as opposing counsel to the specified attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGYevnGAWWENhEQ9\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDpTTZt6KQaRP7Qr\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney with norm id NATYY29p78c7UoyJJ of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_attorney_id: The normAttorneyId value of the attorney for whom opposing-counsel attorneys are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired opposing counsel attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney_serialize( + norm_attorney_id=norm_attorney_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney_with_http_info( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the attorney for whom opposing-counsel attorneys are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired opposing counsel attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByNormAttorneyResponse]: + """Case Count Analytics by Opposing Norm Attorney. + + Retrieve case counts for attorneys who have appeared as opposing counsel to the specified attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGYevnGAWWENhEQ9\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDpTTZt6KQaRP7Qr\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney with norm id NATYY29p78c7UoyJJ of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_attorney_id: The normAttorneyId value of the attorney for whom opposing-counsel attorneys are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired opposing counsel attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney_serialize( + norm_attorney_id=norm_attorney_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney_without_preload_content( + self, + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the attorney for whom opposing-counsel attorneys are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired opposing counsel attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Opposing Norm Attorney. + + Retrieve case counts for attorneys who have appeared as opposing counsel to the specified attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGYevnGAWWENhEQ9\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDpTTZt6KQaRP7Qr\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney with norm id NATYY29p78c7UoyJJ of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_attorney_id: The normAttorneyId value of the attorney for whom opposing-counsel attorneys are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired opposing counsel attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney_serialize( + norm_attorney_id=norm_attorney_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney_serialize( self, norm_attorney_id, - **kwargs - ): - """Case Count Analytics by Opposing Norm Attorney. # noqa: E501 - - Retrieve case counts for attorneys who have appeared as opposing counsel to the specified attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGYevnGAWWENhEQ9\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDpTTZt6KQaRP7Qr\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney with norm id NATYY29p78c7UoyJJ of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney(norm_attorney_id, async_req=True) - >>> result = thread.get() - - Args: - norm_attorney_id (str): The normAttorneyId value of the attorney for whom opposing-counsel attorneys are to be retrieved. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The keyword expression targeting the desired opposing counsel attorneys.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByNormAttorneyResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_attorney_id'] = \ - norm_attorney_id - return self.get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney_endpoint.call_with_http_info(**kwargs) - + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_attorney_id is not None: + _path_params['normAttorneyId'] = norm_attorney_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normAttorney/{normAttorneyId}/caseCountAnalyticsByOpposingNormAttorney', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the law firm for which opposing firms are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired opposing counsel firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByNormLawFirmResponse: + """Case Count Analytics by Opposing Norm Law Firm. + + Retrieve case counts for law firms that have appeared as opposing counsel against the specified law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYp7kmEQtt8jQ3eQ\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_law_firm_id: The normLawFirmId value of the law firm for which opposing firms are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired opposing counsel firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm_serialize( + norm_law_firm_id=norm_law_firm_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm_with_http_info( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the law firm for which opposing firms are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired opposing counsel firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByNormLawFirmResponse]: + """Case Count Analytics by Opposing Norm Law Firm. + + Retrieve case counts for law firms that have appeared as opposing counsel against the specified law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYp7kmEQtt8jQ3eQ\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_law_firm_id: The normLawFirmId value of the law firm for which opposing firms are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired opposing counsel firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm_serialize( + norm_law_firm_id=norm_law_firm_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm_without_preload_content( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the law firm for which opposing firms are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired opposing counsel firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Opposing Norm Law Firm. + + Retrieve case counts for law firms that have appeared as opposing counsel against the specified law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYp7kmEQtt8jQ3eQ\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_law_firm_id: The normLawFirmId value of the law firm for which opposing firms are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired opposing counsel firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm_serialize( + norm_law_firm_id=norm_law_firm_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm_serialize( self, norm_law_firm_id, - **kwargs - ): - """Case Count Analytics by Opposing Norm Law Firm. # noqa: E501 - - Retrieve case counts for law firms that have appeared as opposing counsel against the specified law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYp7kmEQtt8jQ3eQ\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm(norm_law_firm_id, async_req=True) - >>> result = thread.get() - - Args: - norm_law_firm_id (str): The normLawFirmId value of the law firm for which opposing firms are to be retrieved. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The keyword expression targeting the desired opposing counsel firms.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByNormLawFirmResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_law_firm_id'] = \ - norm_law_firm_id - return self.get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm_endpoint.call_with_http_info(**kwargs) - + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_law_firm_id is not None: + _path_params['normLawFirmId'] = norm_law_firm_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normLawFirm/{normLawFirmId}/caseCountAnalyticsByOpposingNormLawFirm', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_opposing_norm_party_for_a_norm_party( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the party for which opposing parties are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the opposing parties that should be retrieved. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByNormPartyResponse: + """Case Count Analytics by Opposing Norm Party. + + Retrieve case counts for parties that have opposed the specified party. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_party_id: The normPartyId value of the party for which opposing parties are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the opposing parties that should be retrieved. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_opposing_norm_party_for_a_norm_party_serialize( + norm_party_id=norm_party_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_opposing_norm_party_for_a_norm_party_with_http_info( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the party for which opposing parties are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the opposing parties that should be retrieved. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByNormPartyResponse]: + """Case Count Analytics by Opposing Norm Party. + + Retrieve case counts for parties that have opposed the specified party. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_party_id: The normPartyId value of the party for which opposing parties are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the opposing parties that should be retrieved. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_opposing_norm_party_for_a_norm_party_serialize( + norm_party_id=norm_party_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_opposing_norm_party_for_a_norm_party_without_preload_content( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the party for which opposing parties are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the opposing parties that should be retrieved. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Opposing Norm Party. + + Retrieve case counts for parties that have opposed the specified party. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_party_id: The normPartyId value of the party for which opposing parties are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the opposing parties that should be retrieved. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_opposing_norm_party_for_a_norm_party_serialize( + norm_party_id=norm_party_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_opposing_norm_party_for_a_norm_party_serialize( self, norm_party_id, - **kwargs - ): - """Case Count Analytics by Opposing Norm Party. # noqa: E501 - - Retrieve case counts for parties that have opposed the specified party. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_opposing_norm_party_for_a_norm_party(norm_party_id, async_req=True) - >>> result = thread.get() - - Args: - norm_party_id (str): The normPartyId value of the party for which opposing parties are to be retrieved. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The keyword expression targeting the opposing parties that should be retrieved. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByNormPartyResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_party_id'] = \ - norm_party_id - return self.get_case_count_analytics_by_opposing_norm_party_for_a_norm_party_endpoint.call_with_http_info(**kwargs) - + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_party_id is not None: + _path_params['normPartyId'] = norm_party_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normParty/{normPartyId}/caseCountAnalyticsByOpposingNormParty', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_party_role( self, - **kwargs - ): - """Case Count Analytics by Party Role. # noqa: E501 - - Retrieve case counts by party type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by party role of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_party_role(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByPartyRoleResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_party_role_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByPartyRoleResponse: + """Case Count Analytics by Party Role. + + Retrieve case counts by party type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by party role of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_party_role_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByPartyRoleResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_party_role_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByPartyRoleResponse]: + """Case Count Analytics by Party Role. + + Retrieve case counts by party type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by party role of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_party_role_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByPartyRoleResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_party_role_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Party Role. + + Retrieve case counts by party type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by party role of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_party_role_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByPartyRoleResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_party_role_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByPartyRole', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_count_analytics_by_party_role_group( self, - **kwargs - ): - """Case Count Analytics by Party Role Group. # noqa: E501 - - Retrieve case counts by party type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Party Role Group of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_count_analytics_by_party_role_group(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseCountAnalyticsByPartyRoleGroupResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_count_analytics_by_party_role_group_endpoint.call_with_http_info(**kwargs) + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseCountAnalyticsByPartyRoleGroupResponse: + """Case Count Analytics by Party Role Group. + + Retrieve case counts by party type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Party Role Group of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_party_role_group_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByPartyRoleGroupResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_count_analytics_by_party_role_group_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByPartyRoleGroupResponse]: + """Case Count Analytics by Party Role Group. + + Retrieve case counts by party type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Party Role Group of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_party_role_group_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByPartyRoleGroupResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_count_analytics_by_party_role_group_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Count Analytics by Party Role Group. + + Retrieve case counts by party type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Party Role Group of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_count_analytics_by_party_role_group_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseCountAnalyticsByPartyRoleGroupResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_count_analytics_by_party_role_group_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseCountAnalyticsByPartyRoleGroup', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + diff --git a/unicourt/api/case_docket_api.py b/unicourt/api/case_docket_api.py index 9ce9d52..700f26a 100644 --- a/unicourt/api/case_docket_api.py +++ b/unicourt/api/case_docket_api.py @@ -1,33 +1,31 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from datetime import datetime +from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated from unicourt.model.attorney import Attorney from unicourt.model.attorneys import Attorneys from unicourt.model.case import Case from unicourt.model.docket_entries import DocketEntries from unicourt.model.docket_entry_primary_documents import DocketEntryPrimaryDocuments from unicourt.model.docket_entry_secondary_documents import DocketEntrySecondaryDocuments -from unicourt.model.exception import Exception from unicourt.model.hearings import Hearings from unicourt.model.judge import Judge from unicourt.model.judges import Judges @@ -36,2206 +34,4249 @@ from unicourt.model.party_attorney_associations import PartyAttorneyAssociations from unicourt.model.related_cases import RelatedCases +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType + -class CaseDocketApi(object): +class CaseDocketApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_attorney_associated_parties_endpoint = _Endpoint( - settings={ - 'response_type': (PartyAttorneyAssociations,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/attorney/{attorneyId}/associatedParties', - 'operation_id': 'get_attorney_associated_parties', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'attorney_id', - 'page_number', - ], - 'required': [ - 'attorney_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'attorney_id', - ] - }, - root_map={ - 'validations': { - ('attorney_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'attorney_id': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'attorney_id': 'attorneyId', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'attorney_id': 'path', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_attorney_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (Attorney,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/attorney/{attorneyId}', - 'operation_id': 'get_attorney_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'attorney_id', - ], - 'required': [ - 'attorney_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'attorney_id', - ] - }, - root_map={ - 'validations': { - ('attorney_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'attorney_id': - (str,), - }, - 'attribute_map': { - 'attorney_id': 'attorneyId', - }, - 'location_map': { - 'attorney_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_endpoint = _Endpoint( - settings={ - 'response_type': (Case,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/case/{caseId}', - 'operation_id': 'get_case', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - ], - 'required': [ - 'case_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_id', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_id': - (str,), - }, - 'attribute_map': { - 'case_id': 'caseId', - }, - 'location_map': { - 'case_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_attorneys_endpoint = _Endpoint( - settings={ - 'response_type': (Attorneys,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/case/{caseId}/attorneys', - 'operation_id': 'get_case_attorneys', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - 'is_visible', - 'page_number', - ], - 'required': [ - 'case_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_id', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_id': - (str,), - 'is_visible': - (bool,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'case_id': 'caseId', - 'is_visible': 'isVisible', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'case_id': 'path', - 'is_visible': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_docket_entries_endpoint = _Endpoint( - settings={ - 'response_type': (DocketEntries,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/case/{caseId}/docketEntries', - 'operation_id': 'get_case_docket_entries', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - 'docket_number', - 'sort_by', - 'page_number', - ], - 'required': [ - 'case_id', - ], - 'nullable': [ - ], - 'enum': [ - 'sort_by', - ], - 'validation': [ - 'case_id', - 'sort_by', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('sort_by',): { - 'max_length': 20, - 'min_length': 10, - }, - }, - 'allowed_values': { - ('sort_by',): { - - "LATEST_TO_OLDEST": "latest to oldest", - "OLDEST_TO_LATEST": "oldest to latest" - }, - }, - 'openapi_types': { - 'case_id': - (str,), - 'docket_number': - (int,), - 'sort_by': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'case_id': 'caseId', - 'docket_number': 'docketNumber', - 'sort_by': 'sortBy', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'case_id': 'path', - 'docket_number': 'query', - 'sort_by': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_hearings_endpoint = _Endpoint( - settings={ - 'response_type': (Hearings,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/case/{caseId}/hearings', - 'operation_id': 'get_case_hearings', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - 'sort_by', - 'page_number', - ], - 'required': [ - 'case_id', - ], - 'nullable': [ - ], - 'enum': [ - 'sort_by', - ], - 'validation': [ - 'case_id', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - ('sort_by',): { - - "LATEST_TO_OLDEST": "latest to oldest", - "OLDEST_TO_LATEST": "oldest to latest" - }, - }, - 'openapi_types': { - 'case_id': - (str,), - 'sort_by': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'case_id': 'caseId', - 'sort_by': 'sortBy', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'case_id': 'path', - 'sort_by': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_judges_endpoint = _Endpoint( - settings={ - 'response_type': (Judges,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/case/{caseId}/judges', - 'operation_id': 'get_case_judges', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - 'is_visible', - 'page_number', - ], - 'required': [ - 'case_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_id', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_id': - (str,), - 'is_visible': - (bool,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'case_id': 'caseId', - 'is_visible': 'isVisible', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'case_id': 'path', - 'is_visible': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_parties_endpoint = _Endpoint( - settings={ - 'response_type': (Parties,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/case/{caseId}/parties', - 'operation_id': 'get_case_parties', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - 'is_visible', - 'page_number', - 'party_role_id', - 'party_role_group_id', - 'attorney_representation_type_id', - 'party_classification_type', - ], - 'required': [ - 'case_id', - ], - 'nullable': [ - ], - 'enum': [ - 'party_classification_type', - ], - 'validation': [ - 'case_id', - 'party_role_id', - 'party_role_group_id', - 'attorney_representation_type_id', - 'party_classification_type', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('party_role_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('party_role_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('attorney_representation_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('party_classification_type',): { - 'max_length': 10, - 'min_length': 5, - }, - }, - 'allowed_values': { - ('party_classification_type',): { - - "INDIVIDUAL": "INDIVIDUAL", - "COMPANY": "COMPANY", - "OTHER": "OTHER" - }, - }, - 'openapi_types': { - 'case_id': - (str,), - 'is_visible': - (bool,), - 'page_number': - (int,), - 'party_role_id': - (str,), - 'party_role_group_id': - (str,), - 'attorney_representation_type_id': - (str,), - 'party_classification_type': - (str,), - }, - 'attribute_map': { - 'case_id': 'caseId', - 'is_visible': 'isVisible', - 'page_number': 'pageNumber', - 'party_role_id': 'partyRoleId', - 'party_role_group_id': 'partyRoleGroupId', - 'attorney_representation_type_id': 'attorneyRepresentationTypeId', - 'party_classification_type': 'partyClassificationType', - }, - 'location_map': { - 'case_id': 'path', - 'is_visible': 'query', - 'page_number': 'query', - 'party_role_id': 'query', - 'party_role_group_id': 'query', - 'attorney_representation_type_id': 'query', - 'party_classification_type': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_related_cases_endpoint = _Endpoint( - settings={ - 'response_type': (RelatedCases,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/case/{caseId}/relatedCases', - 'operation_id': 'get_case_related_cases', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - 'page_number', - ], - 'required': [ - 'case_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_id', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_id': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'case_id': 'caseId', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'case_id': 'path', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_judge_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (Judge,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/judge/{judgeId}', - 'operation_id': 'get_judge_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'judge_id', - ], - 'required': [ - 'judge_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'judge_id', - ] - }, - root_map={ - 'validations': { - ('judge_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'judge_id': - (str,), - }, - 'attribute_map': { - 'judge_id': 'judgeId', - }, - 'location_map': { - 'judge_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_party_associated_attorneys_endpoint = _Endpoint( - settings={ - 'response_type': (PartyAttorneyAssociations,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/party/{partyId}/associatedAttorneys', - 'operation_id': 'get_party_associated_attorneys', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'party_id', - 'page_number', - ], - 'required': [ - 'party_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'party_id', - ] - }, - root_map={ - 'validations': { - ('party_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'party_id': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'party_id': 'partyId', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'party_id': 'path', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_party_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (Party,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/party/{partyId}', - 'operation_id': 'get_party_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'party_id', - ], - 'required': [ - 'party_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'party_id', - ] - }, - root_map={ - 'validations': { - ('party_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'party_id': - (str,), - }, - 'attribute_map': { - 'party_id': 'partyId', - }, - 'location_map': { - 'party_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_primary_documents_for_docket_entries_endpoint = _Endpoint( - settings={ - 'response_type': (DocketEntryPrimaryDocuments,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/case/{caseId}/docketEntries/primaryDocuments', - 'operation_id': 'get_primary_documents_for_docket_entries', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - 'docket_number', - 'in_library', - 'after_first_fetch_date', - 'library_date', - 'page_number', - ], - 'required': [ - 'case_id', - 'docket_number', - ], - 'nullable': [ - 'after_first_fetch_date', - 'library_date', - ], - 'enum': [ - ], - 'validation': [ - 'case_id', - 'after_first_fetch_date', - 'library_date', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('after_first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('library_date',): { - 'max_length': 25, - 'min_length': 25, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_id': - (str,), - 'docket_number': - (int,), - 'in_library': - (bool,), - 'after_first_fetch_date': - (datetime, none_type,), - 'library_date': - (datetime, none_type,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'case_id': 'caseId', - 'docket_number': 'docketNumber', - 'in_library': 'inLibrary', - 'after_first_fetch_date': 'afterFirstFetchDate', - 'library_date': 'libraryDate', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'case_id': 'path', - 'docket_number': 'query', - 'in_library': 'query', - 'after_first_fetch_date': 'query', - 'library_date': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_secondary_documents_for_docket_entries_endpoint = _Endpoint( - settings={ - 'response_type': (DocketEntrySecondaryDocuments,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/case/{caseId}/docketEntries/secondaryDocuments', - 'operation_id': 'get_secondary_documents_for_docket_entries', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - 'docket_number', - 'in_library', - 'after_first_fetch_date', - 'library_date', - 'page_number', - ], - 'required': [ - 'case_id', - 'docket_number', - ], - 'nullable': [ - 'after_first_fetch_date', - 'library_date', - ], - 'enum': [ - ], - 'validation': [ - 'case_id', - 'after_first_fetch_date', - 'library_date', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('after_first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('library_date',): { - 'max_length': 25, - 'min_length': 25, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_id': - (str,), - 'docket_number': - (int,), - 'in_library': - (bool,), - 'after_first_fetch_date': - (datetime, none_type,), - 'library_date': - (datetime, none_type,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'case_id': 'caseId', - 'docket_number': 'docketNumber', - 'in_library': 'inLibrary', - 'after_first_fetch_date': 'afterFirstFetchDate', - 'library_date': 'libraryDate', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'case_id': 'path', - 'docket_number': 'query', - 'in_library': 'query', - 'after_first_fetch_date': 'query', - 'library_date': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def get_attorney_associated_parties( + self, + attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the parties represented by the attorney with the specified attorneyId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PartyAttorneyAssociations: + """Gets Associated Party details for a requested Attorney ID. + + Retrieve the parties represented by the attorney with the specified attorneyId value. + + :param attorney_id: Retrieve the parties represented by the attorney with the specified attorneyId value. (required) + :type attorney_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_associated_parties_serialize( + attorney_id=attorney_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyAttorneyAssociations", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_attorney_associated_parties_with_http_info( + self, + attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the parties represented by the attorney with the specified attorneyId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PartyAttorneyAssociations]: + """Gets Associated Party details for a requested Attorney ID. + + Retrieve the parties represented by the attorney with the specified attorneyId value. + + :param attorney_id: Retrieve the parties represented by the attorney with the specified attorneyId value. (required) + :type attorney_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_associated_parties_serialize( + attorney_id=attorney_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyAttorneyAssociations", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_attorney_associated_parties_without_preload_content( + self, + attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the parties represented by the attorney with the specified attorneyId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets Associated Party details for a requested Attorney ID. + + Retrieve the parties represented by the attorney with the specified attorneyId value. + + :param attorney_id: Retrieve the parties represented by the attorney with the specified attorneyId value. (required) + :type attorney_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_associated_parties_serialize( + attorney_id=attorney_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyAttorneyAssociations", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_attorney_associated_parties_serialize( self, attorney_id, - **kwargs - ): - """Gets Associated Party details for a requested Attorney ID. # noqa: E501 - - Retrieve the parties represented by the attorney with the specified attorneyId value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_attorney_associated_parties(attorney_id, async_req=True) - >>> result = thread.get() - - Args: - attorney_id (str): Retrieve the parties represented by the attorney with the specified attorneyId value. - - Keyword Args: - page_number (int): Query parameter specifying the page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PartyAttorneyAssociations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['attorney_id'] = \ - attorney_id - return self.get_attorney_associated_parties_endpoint.call_with_http_info(**kwargs) + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if attorney_id is not None: + _path_params['attorneyId'] = attorney_id + # process the query parameters + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/attorney/{attorneyId}/associatedParties', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_attorney_by_id( + self, + attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the attorney with the specified attorneyId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Attorney: + """Gets details for a requested Attorney ID. + + Retrieve the attorney with the specified attorneyId value. + + :param attorney_id: Retrieve the attorney with the specified attorneyId value. (required) + :type attorney_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_by_id_serialize( + attorney_id=attorney_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attorney", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_attorney_by_id_with_http_info( + self, + attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the attorney with the specified attorneyId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Attorney]: + """Gets details for a requested Attorney ID. + + Retrieve the attorney with the specified attorneyId value. + + :param attorney_id: Retrieve the attorney with the specified attorneyId value. (required) + :type attorney_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_by_id_serialize( + attorney_id=attorney_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attorney", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_attorney_by_id_without_preload_content( + self, + attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the attorney with the specified attorneyId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets details for a requested Attorney ID. + + Retrieve the attorney with the specified attorneyId value. + + :param attorney_id: Retrieve the attorney with the specified attorneyId value. (required) + :type attorney_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_by_id_serialize( + attorney_id=attorney_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attorney", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_attorney_by_id_serialize( self, attorney_id, - **kwargs - ): - """Gets details for a requested Attorney ID. # noqa: E501 - - Retrieve the attorney with the specified attorneyId value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_attorney_by_id(attorney_id, async_req=True) - >>> result = thread.get() - - Args: - attorney_id (str): Retrieve the attorney with the specified attorneyId value. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Attorney - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['attorney_id'] = \ - attorney_id - return self.get_attorney_by_id_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if attorney_id is not None: + _path_params['attorneyId'] = attorney_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/attorney/{attorneyId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case( self, - case_id, - **kwargs - ): - """Gets case information for a requested Case ID. # noqa: E501 - - Retrieve the case with the specified caseId value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case(case_id, async_req=True) - >>> result = thread.get() - - Args: - case_id (str): Retrieve the case with the specified caseId value. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Case - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_id'] = \ - case_id - return self.get_case_endpoint.call_with_http_info(**kwargs) + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Case: + """Gets case information for a requested Case ID. - def get_case_attorneys( + Retrieve the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Case", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_with_http_info( self, - case_id, - **kwargs - ): - """Gets Attorneys for a requested Case ID. # noqa: E501 - - Retrieve the attorneys in the case with the specified caseId value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_attorneys(case_id, async_req=True) - >>> result = thread.get() - - Args: - case_id (str): Retrieve the case with the specified caseId value. - - Keyword Args: - is_visible (bool): Retrieve attorneys in the case with the specified caseId value whose isVisible flag is set to the specified value.. [optional] - page_number (int): Query parameter specifying the page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Attorneys - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_id'] = \ - case_id - return self.get_case_attorneys_endpoint.call_with_http_info(**kwargs) + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Case]: + """Gets case information for a requested Case ID. - def get_case_docket_entries( + Retrieve the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Case", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_without_preload_content( self, - case_id, - **kwargs - ): - """Gets Docket Entries for a requested Case ID. # noqa: E501 - - Retrieve the docket entries in the case with the specified caseId value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_docket_entries(case_id, async_req=True) - >>> result = thread.get() - - Args: - case_id (str): Retrieve the case with the specified caseId value. - - Keyword Args: - docket_number (int): Retrieve the docket entry witih the specified docket number in the case with the specified caseId value.. [optional] - sort_by (str): Sort the retrieved docket entries in ascending order or descending order of date.. [optional] - page_number (int): Query parameter specifying the page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - DocketEntries - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_id'] = \ - case_id - return self.get_case_docket_entries_endpoint.call_with_http_info(**kwargs) + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets case information for a requested Case ID. - def get_case_hearings( + Retrieve the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Case", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_serialize( self, case_id, - **kwargs - ): - """Gets Hearings for a requested Case ID. # noqa: E501 - - Gets Hearings for a requested Case ID. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_hearings(case_id, async_req=True) - >>> result = thread.get() - - Args: - case_id (str): Retrieve the case with the specified caseId value. - - Keyword Args: - sort_by (str): Specify the sort order of hearings in the case with the specified caseId.. [optional] - page_number (int): Query parameter specifying the page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Hearings - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_id'] = \ - case_id - return self.get_case_hearings_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - def get_case_judges( + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_id is not None: + _path_params['caseId'] = case_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/case/{caseId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_case_attorneys( self, - case_id, - **kwargs - ): - """Gets Judges for a requested Case ID. # noqa: E501 - - Retrieve the judges involved in the specified case. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_judges(case_id, async_req=True) - >>> result = thread.get() - - Args: - case_id (str): Retrieve the case with the specified caseId value. - - Keyword Args: - is_visible (bool): Retrieve attorneys judges in the case with the specified caseId value whose isVisible flag is set to the specified value.. [optional] - page_number (int): Query parameter specifying the page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Judges - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_id'] = \ - case_id - return self.get_case_judges_endpoint.call_with_http_info(**kwargs) + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve attorneys in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Attorneys: + """Gets Attorneys for a requested Case ID. - def get_case_parties( + Retrieve the attorneys in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve attorneys in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_attorneys_serialize( + case_id=case_id, + is_visible=is_visible, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attorneys", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_attorneys_with_http_info( self, - case_id, - **kwargs - ): - """Gets Parties for a requested Case ID. # noqa: E501 - - Retrieve the parties involved in the case with the specified caseId value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_parties(case_id, async_req=True) - >>> result = thread.get() - - Args: - case_id (str): Retrieve the case with the specified caseId value. - - Keyword Args: - is_visible (bool): Retrieve parties in the case with the specified caseId value whose isVisible flag is set to the specified value.. [optional] - page_number (int): Query parameter specifying the page number of the search results to be retrieved.. [optional] - party_role_id (str): Retrieve all parties with the specified partyRoleId value in the case with the specified caseId value.. [optional] - party_role_group_id (str): Retrieve all parties with the specified partyRoleGroupId value in the case with the specified caseId value.. [optional] - attorney_representation_type_id (str): Retrieve all parties with the specified attorneyRepresentationTypeId value in the case with the specified caseId value.. [optional] - party_classification_type (str): Retrieve all parties with the specified partyClassificationType value in the case with the specified caseId value.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Parties - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_id'] = \ - case_id - return self.get_case_parties_endpoint.call_with_http_info(**kwargs) + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve attorneys in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Attorneys]: + """Gets Attorneys for a requested Case ID. - def get_case_related_cases( + Retrieve the attorneys in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve attorneys in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_attorneys_serialize( + case_id=case_id, + is_visible=is_visible, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attorneys", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_attorneys_without_preload_content( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve attorneys in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets Attorneys for a requested Case ID. + + Retrieve the attorneys in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve attorneys in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_attorneys_serialize( + case_id=case_id, + is_visible=is_visible, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Attorneys", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_attorneys_serialize( self, case_id, - **kwargs - ): - """Gets Related Cases for a requested Case ID. # noqa: E501 - - Retrieve cases that UniCourt has identified as related to the case with the specified caseId value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_related_cases(case_id, async_req=True) - >>> result = thread.get() - - Args: - case_id (str): Retrieve the case with the specified caseId value. - - Keyword Args: - page_number (int): Query parameter specifying the page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - RelatedCases - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_id'] = \ - case_id - return self.get_case_related_cases_endpoint.call_with_http_info(**kwargs) + is_visible, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - def get_judge_by_id( + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_id is not None: + _path_params['caseId'] = case_id + # process the query parameters + if is_visible is not None: + + _query_params.append(('isVisible', is_visible)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/case/{caseId}/attorneys', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_case_docket_entries( self, - judge_id, - **kwargs - ): - """Gets details for a requested Judge ID. # noqa: E501 - - Retrieve the judge with the specified judgeId value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_judge_by_id(judge_id, async_req=True) - >>> result = thread.get() - - Args: - judge_id (str): Retrieve the judge with the specified judgeId value. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Judge - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['judge_id'] = \ - judge_id - return self.get_judge_by_id_endpoint.call_with_http_info(**kwargs) + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + docket_number: Annotated[Optional[StrictInt], Field(description="Retrieve the docket entry witih the specified docket number in the case with the specified caseId value.")] = None, + sort_by: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=20)]], Field(description="Sort the retrieved docket entries in ascending order or descending order of date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DocketEntries: + """Gets Docket Entries for a requested Case ID. - def get_party_associated_attorneys( + Retrieve the docket entries in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param docket_number: Retrieve the docket entry witih the specified docket number in the case with the specified caseId value. + :type docket_number: int + :param sort_by: Sort the retrieved docket entries in ascending order or descending order of date. + :type sort_by: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_docket_entries_serialize( + case_id=case_id, + docket_number=docket_number, + sort_by=sort_by, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocketEntries", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_docket_entries_with_http_info( self, - party_id, - **kwargs - ): - """Gets Associated Attorney details for a requested Party ID. # noqa: E501 - - Retrieve the attorneys in the case with the specified partyId value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_party_associated_attorneys(party_id, async_req=True) - >>> result = thread.get() - - Args: - party_id (str): Retrieve the party with the specified partyId value. - - Keyword Args: - page_number (int): Query parameter specifying the page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PartyAttorneyAssociations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['party_id'] = \ - party_id - return self.get_party_associated_attorneys_endpoint.call_with_http_info(**kwargs) + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + docket_number: Annotated[Optional[StrictInt], Field(description="Retrieve the docket entry witih the specified docket number in the case with the specified caseId value.")] = None, + sort_by: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=20)]], Field(description="Sort the retrieved docket entries in ascending order or descending order of date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocketEntries]: + """Gets Docket Entries for a requested Case ID. - def get_party_by_id( + Retrieve the docket entries in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param docket_number: Retrieve the docket entry witih the specified docket number in the case with the specified caseId value. + :type docket_number: int + :param sort_by: Sort the retrieved docket entries in ascending order or descending order of date. + :type sort_by: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_docket_entries_serialize( + case_id=case_id, + docket_number=docket_number, + sort_by=sort_by, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocketEntries", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_docket_entries_without_preload_content( self, - party_id, - **kwargs - ): - """Gets details for a requested Party ID. # noqa: E501 - - Retrieve the party with the specified partyId value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_party_by_id(party_id, async_req=True) - >>> result = thread.get() - - Args: - party_id (str): Retrieve the party with the specified partyId value. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Party - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['party_id'] = \ - party_id - return self.get_party_by_id_endpoint.call_with_http_info(**kwargs) + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + docket_number: Annotated[Optional[StrictInt], Field(description="Retrieve the docket entry witih the specified docket number in the case with the specified caseId value.")] = None, + sort_by: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=20)]], Field(description="Sort the retrieved docket entries in ascending order or descending order of date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets Docket Entries for a requested Case ID. - def get_primary_documents_for_docket_entries( + Retrieve the docket entries in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param docket_number: Retrieve the docket entry witih the specified docket number in the case with the specified caseId value. + :type docket_number: int + :param sort_by: Sort the retrieved docket entries in ascending order or descending order of date. + :type sort_by: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_docket_entries_serialize( + case_id=case_id, + docket_number=docket_number, + sort_by=sort_by, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocketEntries", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_docket_entries_serialize( self, case_id, docket_number, - **kwargs - ): - """Gets Primary Documents of Docket Entries. # noqa: E501 - - Retrieve the primary documents in the case with the specified caseId value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_primary_documents_for_docket_entries(case_id, docket_number, async_req=True) - >>> result = thread.get() - - Args: - case_id (str): Retrieve the case with the specified caseId value. - docket_number (int): Retrieve the primary documents associated with the specified docket number in the case with the specified caseId value. - - Keyword Args: - in_library (bool): Retrieve the primary documents in the with the specified inLibrary flag in the case with the specified caseId value.. [optional] - after_first_fetch_date (datetime, none_type): Retrieve all primary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date.. [optional] - library_date (datetime, none_type): Retrieve all primary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date.. [optional] - page_number (int): Query parameter specifying the page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - DocketEntryPrimaryDocuments - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_id'] = \ - case_id - kwargs['docket_number'] = \ - docket_number - return self.get_primary_documents_for_docket_entries_endpoint.call_with_http_info(**kwargs) + sort_by, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - def get_secondary_documents_for_docket_entries( + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_id is not None: + _path_params['caseId'] = case_id + # process the query parameters + if docket_number is not None: + + _query_params.append(('docketNumber', docket_number)) + + if sort_by is not None: + + _query_params.append(('sortBy', sort_by)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/case/{caseId}/docketEntries', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_case_hearings( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + sort_by: Annotated[Optional[StrictStr], Field(description="Specify the sort order of hearings in the case with the specified caseId.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Hearings: + """Gets Hearings for a requested Case ID. + + Gets Hearings for a requested Case ID. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param sort_by: Specify the sort order of hearings in the case with the specified caseId. + :type sort_by: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_hearings_serialize( + case_id=case_id, + sort_by=sort_by, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Hearings", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_hearings_with_http_info( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + sort_by: Annotated[Optional[StrictStr], Field(description="Specify the sort order of hearings in the case with the specified caseId.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Hearings]: + """Gets Hearings for a requested Case ID. + + Gets Hearings for a requested Case ID. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param sort_by: Specify the sort order of hearings in the case with the specified caseId. + :type sort_by: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_hearings_serialize( + case_id=case_id, + sort_by=sort_by, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Hearings", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_hearings_without_preload_content( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + sort_by: Annotated[Optional[StrictStr], Field(description="Specify the sort order of hearings in the case with the specified caseId.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets Hearings for a requested Case ID. + + Gets Hearings for a requested Case ID. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param sort_by: Specify the sort order of hearings in the case with the specified caseId. + :type sort_by: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_hearings_serialize( + case_id=case_id, + sort_by=sort_by, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Hearings", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_hearings_serialize( self, case_id, - docket_number, - **kwargs - ): - """Gets Secondary Documents of Docket Entries. # noqa: E501 - - Retrieve the secondary documents in the case with the specified caseId value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_secondary_documents_for_docket_entries(case_id, docket_number, async_req=True) - >>> result = thread.get() - - Args: - case_id (str): Retrieve the case with the specified caseId value. - docket_number (int): Retrieve the secondary documents associated with the specified docket number in the case with the specified caseId value. - - Keyword Args: - in_library (bool): Retrieve the secondary documents in the with the specified inLibrary flag in the case with the specified caseId value.. [optional] - after_first_fetch_date (datetime, none_type): Retrieve all secondary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date.. [optional] - library_date (datetime, none_type): Retrieve all secondary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date.. [optional] - page_number (int): Query parameter specifying the page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - DocketEntrySecondaryDocuments - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_id'] = \ - case_id - kwargs['docket_number'] = \ - docket_number - return self.get_secondary_documents_for_docket_entries_endpoint.call_with_http_info(**kwargs) + sort_by, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_id is not None: + _path_params['caseId'] = case_id + # process the query parameters + if sort_by is not None: + + _query_params.append(('sortBy', sort_by)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/case/{caseId}/hearings', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_case_judges( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve attorneys judges in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Judges: + """Gets Judges for a requested Case ID. + + Retrieve the judges involved in the specified case. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve attorneys judges in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_judges_serialize( + case_id=case_id, + is_visible=is_visible, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Judges", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_judges_with_http_info( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve attorneys judges in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Judges]: + """Gets Judges for a requested Case ID. + + Retrieve the judges involved in the specified case. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve attorneys judges in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_judges_serialize( + case_id=case_id, + is_visible=is_visible, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Judges", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_judges_without_preload_content( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve attorneys judges in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets Judges for a requested Case ID. + + Retrieve the judges involved in the specified case. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve attorneys judges in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_judges_serialize( + case_id=case_id, + is_visible=is_visible, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Judges", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_judges_serialize( + self, + case_id, + is_visible, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_id is not None: + _path_params['caseId'] = case_id + # process the query parameters + if is_visible is not None: + + _query_params.append(('isVisible', is_visible)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/case/{caseId}/judges', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_case_parties( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve parties in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + party_role_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified partyRoleId value in the case with the specified caseId value.")] = None, + party_role_group_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified partyRoleGroupId value in the case with the specified caseId value.")] = None, + attorney_representation_type_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified attorneyRepresentationTypeId value in the case with the specified caseId value.")] = None, + party_classification_type: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=10)]], Field(description="Retrieve all parties with the specified partyClassificationType value in the case with the specified caseId value.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Parties: + """Gets Parties for a requested Case ID. + + Retrieve the parties involved in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve parties in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param party_role_id: Retrieve all parties with the specified partyRoleId value in the case with the specified caseId value. + :type party_role_id: str + :param party_role_group_id: Retrieve all parties with the specified partyRoleGroupId value in the case with the specified caseId value. + :type party_role_group_id: str + :param attorney_representation_type_id: Retrieve all parties with the specified attorneyRepresentationTypeId value in the case with the specified caseId value. + :type attorney_representation_type_id: str + :param party_classification_type: Retrieve all parties with the specified partyClassificationType value in the case with the specified caseId value. + :type party_classification_type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_parties_serialize( + case_id=case_id, + is_visible=is_visible, + page_number=page_number, + party_role_id=party_role_id, + party_role_group_id=party_role_group_id, + attorney_representation_type_id=attorney_representation_type_id, + party_classification_type=party_classification_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Parties", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_parties_with_http_info( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve parties in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + party_role_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified partyRoleId value in the case with the specified caseId value.")] = None, + party_role_group_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified partyRoleGroupId value in the case with the specified caseId value.")] = None, + attorney_representation_type_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified attorneyRepresentationTypeId value in the case with the specified caseId value.")] = None, + party_classification_type: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=10)]], Field(description="Retrieve all parties with the specified partyClassificationType value in the case with the specified caseId value.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Parties]: + """Gets Parties for a requested Case ID. + + Retrieve the parties involved in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve parties in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param party_role_id: Retrieve all parties with the specified partyRoleId value in the case with the specified caseId value. + :type party_role_id: str + :param party_role_group_id: Retrieve all parties with the specified partyRoleGroupId value in the case with the specified caseId value. + :type party_role_group_id: str + :param attorney_representation_type_id: Retrieve all parties with the specified attorneyRepresentationTypeId value in the case with the specified caseId value. + :type attorney_representation_type_id: str + :param party_classification_type: Retrieve all parties with the specified partyClassificationType value in the case with the specified caseId value. + :type party_classification_type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_parties_serialize( + case_id=case_id, + is_visible=is_visible, + page_number=page_number, + party_role_id=party_role_id, + party_role_group_id=party_role_group_id, + attorney_representation_type_id=attorney_representation_type_id, + party_classification_type=party_classification_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Parties", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_parties_without_preload_content( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve parties in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + party_role_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified partyRoleId value in the case with the specified caseId value.")] = None, + party_role_group_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified partyRoleGroupId value in the case with the specified caseId value.")] = None, + attorney_representation_type_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified attorneyRepresentationTypeId value in the case with the specified caseId value.")] = None, + party_classification_type: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=10)]], Field(description="Retrieve all parties with the specified partyClassificationType value in the case with the specified caseId value.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets Parties for a requested Case ID. + + Retrieve the parties involved in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve parties in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param party_role_id: Retrieve all parties with the specified partyRoleId value in the case with the specified caseId value. + :type party_role_id: str + :param party_role_group_id: Retrieve all parties with the specified partyRoleGroupId value in the case with the specified caseId value. + :type party_role_group_id: str + :param attorney_representation_type_id: Retrieve all parties with the specified attorneyRepresentationTypeId value in the case with the specified caseId value. + :type attorney_representation_type_id: str + :param party_classification_type: Retrieve all parties with the specified partyClassificationType value in the case with the specified caseId value. + :type party_classification_type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_parties_serialize( + case_id=case_id, + is_visible=is_visible, + page_number=page_number, + party_role_id=party_role_id, + party_role_group_id=party_role_group_id, + attorney_representation_type_id=attorney_representation_type_id, + party_classification_type=party_classification_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Parties", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_parties_serialize( + self, + case_id, + is_visible, + page_number, + party_role_id, + party_role_group_id, + attorney_representation_type_id, + party_classification_type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_id is not None: + _path_params['caseId'] = case_id + # process the query parameters + if is_visible is not None: + + _query_params.append(('isVisible', is_visible)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if party_role_id is not None: + + _query_params.append(('partyRoleId', party_role_id)) + + if party_role_group_id is not None: + + _query_params.append(('partyRoleGroupId', party_role_group_id)) + + if attorney_representation_type_id is not None: + + _query_params.append(('attorneyRepresentationTypeId', attorney_representation_type_id)) + + if party_classification_type is not None: + + _query_params.append(('partyClassificationType', party_classification_type)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/case/{caseId}/parties', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_case_related_cases( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RelatedCases: + """Gets Related Cases for a requested Case ID. + + Retrieve cases that UniCourt has identified as related to the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_related_cases_serialize( + case_id=case_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RelatedCases", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_related_cases_with_http_info( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RelatedCases]: + """Gets Related Cases for a requested Case ID. + + Retrieve cases that UniCourt has identified as related to the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_related_cases_serialize( + case_id=case_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RelatedCases", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_related_cases_without_preload_content( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets Related Cases for a requested Case ID. + + Retrieve cases that UniCourt has identified as related to the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_related_cases_serialize( + case_id=case_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RelatedCases", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_related_cases_serialize( + self, + case_id, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_id is not None: + _path_params['caseId'] = case_id + # process the query parameters + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/case/{caseId}/relatedCases', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_judge_by_id( + self, + judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the judge with the specified judgeId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Judge: + """Gets details for a requested Judge ID. + + Retrieve the judge with the specified judgeId value. + + :param judge_id: Retrieve the judge with the specified judgeId value. (required) + :type judge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_judge_by_id_serialize( + judge_id=judge_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Judge", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_judge_by_id_with_http_info( + self, + judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the judge with the specified judgeId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Judge]: + """Gets details for a requested Judge ID. + + Retrieve the judge with the specified judgeId value. + + :param judge_id: Retrieve the judge with the specified judgeId value. (required) + :type judge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_judge_by_id_serialize( + judge_id=judge_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Judge", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_judge_by_id_without_preload_content( + self, + judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the judge with the specified judgeId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets details for a requested Judge ID. + + Retrieve the judge with the specified judgeId value. + + :param judge_id: Retrieve the judge with the specified judgeId value. (required) + :type judge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_judge_by_id_serialize( + judge_id=judge_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Judge", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_judge_by_id_serialize( + self, + judge_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if judge_id is not None: + _path_params['judgeId'] = judge_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/judge/{judgeId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_party_associated_attorneys( + self, + party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the party with the specified partyId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PartyAttorneyAssociations: + """Gets Associated Attorney details for a requested Party ID. + + Retrieve the attorneys in the case with the specified partyId value. + + :param party_id: Retrieve the party with the specified partyId value. (required) + :type party_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_associated_attorneys_serialize( + party_id=party_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyAttorneyAssociations", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_party_associated_attorneys_with_http_info( + self, + party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the party with the specified partyId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PartyAttorneyAssociations]: + """Gets Associated Attorney details for a requested Party ID. + + Retrieve the attorneys in the case with the specified partyId value. + + :param party_id: Retrieve the party with the specified partyId value. (required) + :type party_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_associated_attorneys_serialize( + party_id=party_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyAttorneyAssociations", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_party_associated_attorneys_without_preload_content( + self, + party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the party with the specified partyId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets Associated Attorney details for a requested Party ID. + + Retrieve the attorneys in the case with the specified partyId value. + + :param party_id: Retrieve the party with the specified partyId value. (required) + :type party_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_associated_attorneys_serialize( + party_id=party_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyAttorneyAssociations", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_party_associated_attorneys_serialize( + self, + party_id, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if party_id is not None: + _path_params['partyId'] = party_id + # process the query parameters + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/party/{partyId}/associatedAttorneys', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_party_by_id( + self, + party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the party with the specified partyId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Party: + """Gets details for a requested Party ID. + + Retrieve the party with the specified partyId value. + + :param party_id: Retrieve the party with the specified partyId value. (required) + :type party_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_by_id_serialize( + party_id=party_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Party", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_party_by_id_with_http_info( + self, + party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the party with the specified partyId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Party]: + """Gets details for a requested Party ID. + + Retrieve the party with the specified partyId value. + + :param party_id: Retrieve the party with the specified partyId value. (required) + :type party_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_by_id_serialize( + party_id=party_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Party", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_party_by_id_without_preload_content( + self, + party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the party with the specified partyId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets details for a requested Party ID. + + Retrieve the party with the specified partyId value. + + :param party_id: Retrieve the party with the specified partyId value. (required) + :type party_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_by_id_serialize( + party_id=party_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Party", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_party_by_id_serialize( + self, + party_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if party_id is not None: + _path_params['partyId'] = party_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/party/{partyId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_primary_documents_for_docket_entries( + self, + docket_number: Annotated[StrictInt, Field(description="Retrieve the primary documents associated with the specified docket number in the case with the specified caseId value.")], + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + in_library: Annotated[Optional[StrictBool], Field(description="Retrieve the primary documents in the with the specified inLibrary flag in the case with the specified caseId value.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Retrieve all primary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Retrieve all primary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DocketEntryPrimaryDocuments: + """Gets Primary Documents of Docket Entries. + + Retrieve the primary documents in the case with the specified caseId value. + + :param docket_number: Retrieve the primary documents associated with the specified docket number in the case with the specified caseId value. (required) + :type docket_number: int + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param in_library: Retrieve the primary documents in the with the specified inLibrary flag in the case with the specified caseId value. + :type in_library: bool + :param after_first_fetch_date: Retrieve all primary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date. + :type after_first_fetch_date: datetime + :param library_date: Retrieve all primary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date. + :type library_date: datetime + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_primary_documents_for_docket_entries_serialize( + docket_number=docket_number, + case_id=case_id, + in_library=in_library, + after_first_fetch_date=after_first_fetch_date, + library_date=library_date, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocketEntryPrimaryDocuments", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_primary_documents_for_docket_entries_with_http_info( + self, + docket_number: Annotated[StrictInt, Field(description="Retrieve the primary documents associated with the specified docket number in the case with the specified caseId value.")], + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + in_library: Annotated[Optional[StrictBool], Field(description="Retrieve the primary documents in the with the specified inLibrary flag in the case with the specified caseId value.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Retrieve all primary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Retrieve all primary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocketEntryPrimaryDocuments]: + """Gets Primary Documents of Docket Entries. + + Retrieve the primary documents in the case with the specified caseId value. + + :param docket_number: Retrieve the primary documents associated with the specified docket number in the case with the specified caseId value. (required) + :type docket_number: int + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param in_library: Retrieve the primary documents in the with the specified inLibrary flag in the case with the specified caseId value. + :type in_library: bool + :param after_first_fetch_date: Retrieve all primary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date. + :type after_first_fetch_date: datetime + :param library_date: Retrieve all primary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date. + :type library_date: datetime + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_primary_documents_for_docket_entries_serialize( + docket_number=docket_number, + case_id=case_id, + in_library=in_library, + after_first_fetch_date=after_first_fetch_date, + library_date=library_date, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocketEntryPrimaryDocuments", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_primary_documents_for_docket_entries_without_preload_content( + self, + docket_number: Annotated[StrictInt, Field(description="Retrieve the primary documents associated with the specified docket number in the case with the specified caseId value.")], + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + in_library: Annotated[Optional[StrictBool], Field(description="Retrieve the primary documents in the with the specified inLibrary flag in the case with the specified caseId value.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Retrieve all primary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Retrieve all primary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets Primary Documents of Docket Entries. + + Retrieve the primary documents in the case with the specified caseId value. + + :param docket_number: Retrieve the primary documents associated with the specified docket number in the case with the specified caseId value. (required) + :type docket_number: int + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param in_library: Retrieve the primary documents in the with the specified inLibrary flag in the case with the specified caseId value. + :type in_library: bool + :param after_first_fetch_date: Retrieve all primary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date. + :type after_first_fetch_date: datetime + :param library_date: Retrieve all primary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date. + :type library_date: datetime + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_primary_documents_for_docket_entries_serialize( + docket_number=docket_number, + case_id=case_id, + in_library=in_library, + after_first_fetch_date=after_first_fetch_date, + library_date=library_date, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocketEntryPrimaryDocuments", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_primary_documents_for_docket_entries_serialize( + self, + docket_number, + case_id, + in_library, + after_first_fetch_date, + library_date, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_id is not None: + _path_params['caseId'] = case_id + # process the query parameters + if docket_number is not None: + + _query_params.append(('docketNumber', docket_number)) + + if in_library is not None: + + _query_params.append(('inLibrary', in_library)) + + if after_first_fetch_date is not None: + if isinstance(after_first_fetch_date, datetime): + _query_params.append( + ( + 'afterFirstFetchDate', + after_first_fetch_date + ) + ) + else: + _query_params.append(('afterFirstFetchDate', after_first_fetch_date)) + + if library_date is not None: + if isinstance(library_date, datetime): + _query_params.append( + ( + 'libraryDate', + library_date + ) + ) + else: + _query_params.append(('libraryDate', library_date)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/case/{caseId}/docketEntries/primaryDocuments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_secondary_documents_for_docket_entries( + self, + docket_number: Annotated[StrictInt, Field(description="Retrieve the secondary documents associated with the specified docket number in the case with the specified caseId value.")], + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + in_library: Annotated[Optional[StrictBool], Field(description="Retrieve the secondary documents in the with the specified inLibrary flag in the case with the specified caseId value.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Retrieve all secondary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Retrieve all secondary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DocketEntrySecondaryDocuments: + """Gets Secondary Documents of Docket Entries. + + Retrieve the secondary documents in the case with the specified caseId value. + + :param docket_number: Retrieve the secondary documents associated with the specified docket number in the case with the specified caseId value. (required) + :type docket_number: int + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param in_library: Retrieve the secondary documents in the with the specified inLibrary flag in the case with the specified caseId value. + :type in_library: bool + :param after_first_fetch_date: Retrieve all secondary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date. + :type after_first_fetch_date: datetime + :param library_date: Retrieve all secondary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date. + :type library_date: datetime + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_secondary_documents_for_docket_entries_serialize( + docket_number=docket_number, + case_id=case_id, + in_library=in_library, + after_first_fetch_date=after_first_fetch_date, + library_date=library_date, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocketEntrySecondaryDocuments", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_secondary_documents_for_docket_entries_with_http_info( + self, + docket_number: Annotated[StrictInt, Field(description="Retrieve the secondary documents associated with the specified docket number in the case with the specified caseId value.")], + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + in_library: Annotated[Optional[StrictBool], Field(description="Retrieve the secondary documents in the with the specified inLibrary flag in the case with the specified caseId value.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Retrieve all secondary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Retrieve all secondary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocketEntrySecondaryDocuments]: + """Gets Secondary Documents of Docket Entries. + + Retrieve the secondary documents in the case with the specified caseId value. + + :param docket_number: Retrieve the secondary documents associated with the specified docket number in the case with the specified caseId value. (required) + :type docket_number: int + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param in_library: Retrieve the secondary documents in the with the specified inLibrary flag in the case with the specified caseId value. + :type in_library: bool + :param after_first_fetch_date: Retrieve all secondary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date. + :type after_first_fetch_date: datetime + :param library_date: Retrieve all secondary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date. + :type library_date: datetime + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_secondary_documents_for_docket_entries_serialize( + docket_number=docket_number, + case_id=case_id, + in_library=in_library, + after_first_fetch_date=after_first_fetch_date, + library_date=library_date, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocketEntrySecondaryDocuments", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_secondary_documents_for_docket_entries_without_preload_content( + self, + docket_number: Annotated[StrictInt, Field(description="Retrieve the secondary documents associated with the specified docket number in the case with the specified caseId value.")], + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + in_library: Annotated[Optional[StrictBool], Field(description="Retrieve the secondary documents in the with the specified inLibrary flag in the case with the specified caseId value.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Retrieve all secondary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Retrieve all secondary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets Secondary Documents of Docket Entries. + + Retrieve the secondary documents in the case with the specified caseId value. + + :param docket_number: Retrieve the secondary documents associated with the specified docket number in the case with the specified caseId value. (required) + :type docket_number: int + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param in_library: Retrieve the secondary documents in the with the specified inLibrary flag in the case with the specified caseId value. + :type in_library: bool + :param after_first_fetch_date: Retrieve all secondary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date. + :type after_first_fetch_date: datetime + :param library_date: Retrieve all secondary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date. + :type library_date: datetime + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_secondary_documents_for_docket_entries_serialize( + docket_number=docket_number, + case_id=case_id, + in_library=in_library, + after_first_fetch_date=after_first_fetch_date, + library_date=library_date, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocketEntrySecondaryDocuments", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_secondary_documents_for_docket_entries_serialize( + self, + docket_number, + case_id, + in_library, + after_first_fetch_date, + library_date, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_id is not None: + _path_params['caseId'] = case_id + # process the query parameters + if docket_number is not None: + + _query_params.append(('docketNumber', docket_number)) + + if in_library is not None: + + _query_params.append(('inLibrary', in_library)) + + if after_first_fetch_date is not None: + if isinstance(after_first_fetch_date, datetime): + _query_params.append( + ( + 'afterFirstFetchDate', + after_first_fetch_date + ) + ) + else: + _query_params.append(('afterFirstFetchDate', after_first_fetch_date)) + + if library_date is not None: + if isinstance(library_date, datetime): + _query_params.append( + ( + 'libraryDate', + library_date + ) + ) + else: + _query_params.append(('libraryDate', library_date)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/case/{caseId}/docketEntries/secondaryDocuments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + diff --git a/unicourt/api/case_documents_api.py b/unicourt/api/case_documents_api.py index 93b2b63..fb69a28 100644 --- a/unicourt/api/case_documents_api.py +++ b/unicourt/api/case_documents_api.py @@ -1,963 +1,1831 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from datetime import datetime +from pydantic import Field, StrictBool, StrictInt, field_validator +from typing import Optional +from typing_extensions import Annotated from unicourt.model.case_document import CaseDocument from unicourt.model.case_document_order_callback import CaseDocumentOrderCallback from unicourt.model.case_document_order_callback_list_response import CaseDocumentOrderCallbackListResponse from unicourt.model.case_document_order_request import CaseDocumentOrderRequest from unicourt.model.case_documents import CaseDocuments from unicourt.model.document_download import DocumentDownload -from unicourt.model.exception import Exception + +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType -class CaseDocumentsApi(object): +class CaseDocumentsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_case_document_download_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (DocumentDownload,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseDocumentDownload/{caseDocumentId}', - 'operation_id': 'get_case_document_download_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_document_id', - 'is_preview_document', - ], - 'required': [ - 'case_document_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_document_id', - ] - }, - root_map={ - 'validations': { - ('case_document_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_document_id': - (str,), - 'is_preview_document': - (bool,), - }, - 'attribute_map': { - 'case_document_id': 'caseDocumentId', - 'is_preview_document': 'isPreviewDocument', - }, - 'location_map': { - 'case_document_id': 'path', - 'is_preview_document': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_document_order_callback_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (CaseDocumentOrderCallback,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseDocumentOrder/callbacks/{caseDocumentOrderCallbackId}', - 'operation_id': 'get_case_document_order_callback_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_document_order_callback_id', - ], - 'required': [ - 'case_document_order_callback_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_document_order_callback_id', - ] - }, - root_map={ - 'validations': { - ('case_document_order_callback_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_document_order_callback_id': - (str,), - }, - 'attribute_map': { - 'case_document_order_callback_id': 'caseDocumentOrderCallbackId', - }, - 'location_map': { - 'case_document_order_callback_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_document_order_callbacks_endpoint = _Endpoint( - settings={ - 'response_type': (CaseDocumentOrderCallbackListResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseDocumentOrder/callbacks', - 'operation_id': 'get_case_document_order_callbacks', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'date', - 'status', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'status', - ], - 'validation': [ - 'date', - 'status', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('status',): { - 'max_length': 11, - 'min_length': 7, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - ('status',): { - - "IN_PROGRESS": "IN_PROGRESS", - "DELAYED": "DELAYED", - "COMPLETE": "COMPLETE", - "FAILURE": "FAILURE" - }, - }, - 'openapi_types': { - 'date': - (datetime,), - 'status': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'date': 'date', - 'status': 'status', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'date': 'query', - 'status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_documents_endpoint = _Endpoint( - settings={ - 'response_type': (CaseDocuments,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/case/{caseId}/documents', - 'operation_id': 'get_case_documents', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - 'in_library', - 'after_first_fetch_date', - 'library_date', - 'first_fetch_date', - 'sort_by', - 'page_number', - ], - 'required': [ - 'case_id', - ], - 'nullable': [ - 'after_first_fetch_date', - 'library_date', - 'first_fetch_date', - ], - 'enum': [ - 'sort_by', - ], - 'validation': [ - 'case_id', - 'after_first_fetch_date', - 'library_date', - 'first_fetch_date', - 'sort_by', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('after_first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('library_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('sort_by',): { - 'max_length': 20, - 'min_length': 10, - }, - }, - 'allowed_values': { - ('sort_by',): { - - "LATEST_TO_OLDEST": "latest to oldest", - "OLDEST_TO_LATEST": "oldest to latest" - }, - }, - 'openapi_types': { - 'case_id': - (str,), - 'in_library': - (bool,), - 'after_first_fetch_date': - (datetime, none_type,), - 'library_date': - (datetime, none_type,), - 'first_fetch_date': - (datetime, none_type,), - 'sort_by': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'case_id': 'caseId', - 'in_library': 'inLibrary', - 'after_first_fetch_date': 'afterFirstFetchDate', - 'library_date': 'libraryDate', - 'first_fetch_date': 'firstFetchDate', - 'sort_by': 'sortBy', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'case_id': 'path', - 'in_library': 'query', - 'after_first_fetch_date': 'query', - 'library_date': 'query', - 'first_fetch_date': 'query', - 'sort_by': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_document_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (CaseDocument,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseDocument/{caseDocumentId}', - 'operation_id': 'get_document_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_document_id', - ], - 'required': [ - 'case_document_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_document_id', - ] - }, - root_map={ - 'validations': { - ('case_document_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_document_id': - (str,), - }, - 'attribute_map': { - 'case_document_id': 'caseDocumentId', - }, - 'location_map': { - 'case_document_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.order_case_document_endpoint = _Endpoint( - settings={ - 'response_type': (CaseDocumentOrderCallback,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseDocumentOrder', - 'operation_id': 'order_case_document', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_document_order_request', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_document_order_request': - (CaseDocumentOrderRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'case_document_order_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def get_case_document_download_by_id( + self, + case_document_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Document ID which you want to download.")], + is_preview_document: Annotated[Optional[StrictBool], Field(description="If the document you want to download is a preview of a document.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DocumentDownload: + """Gets downloadable URL for a requested Document ID. + + Gets downloadable URL for a requested Document ID. + + :param case_document_id: Document ID which you want to download. (required) + :type case_document_id: str + :param is_preview_document: If the document you want to download is a preview of a document. + :type is_preview_document: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_document_download_by_id_serialize( + case_document_id=case_document_id, + is_preview_document=is_preview_document, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentDownload", + '400': "Exception", + '403': "Exception", + '404': "Exception", + '451': "DocumentDownload", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_document_download_by_id_with_http_info( + self, + case_document_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Document ID which you want to download.")], + is_preview_document: Annotated[Optional[StrictBool], Field(description="If the document you want to download is a preview of a document.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocumentDownload]: + """Gets downloadable URL for a requested Document ID. + + Gets downloadable URL for a requested Document ID. + + :param case_document_id: Document ID which you want to download. (required) + :type case_document_id: str + :param is_preview_document: If the document you want to download is a preview of a document. + :type is_preview_document: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_document_download_by_id_serialize( + case_document_id=case_document_id, + is_preview_document=is_preview_document, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentDownload", + '400': "Exception", + '403': "Exception", + '404': "Exception", + '451': "DocumentDownload", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_document_download_by_id_without_preload_content( + self, + case_document_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Document ID which you want to download.")], + is_preview_document: Annotated[Optional[StrictBool], Field(description="If the document you want to download is a preview of a document.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets downloadable URL for a requested Document ID. + + Gets downloadable URL for a requested Document ID. + + :param case_document_id: Document ID which you want to download. (required) + :type case_document_id: str + :param is_preview_document: If the document you want to download is a preview of a document. + :type is_preview_document: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_document_download_by_id_serialize( + case_document_id=case_document_id, + is_preview_document=is_preview_document, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DocumentDownload", + '400': "Exception", + '403': "Exception", + '404': "Exception", + '451': "DocumentDownload", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_document_download_by_id_serialize( self, case_document_id, - **kwargs - ): - """Gets downloadable URL for a requested Document ID. # noqa: E501 - - Gets downloadable URL for a requested Document ID. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_document_download_by_id(case_document_id, async_req=True) - >>> result = thread.get() - - Args: - case_document_id (str): Document ID which you want to download. - - Keyword Args: - is_preview_document (bool): If the document you want to download is a preview of a document.. [optional] if omitted the server will use the default value of False - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - DocumentDownload - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_document_id'] = \ - case_document_id - return self.get_case_document_download_by_id_endpoint.call_with_http_info(**kwargs) + is_preview_document, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_document_id is not None: + _path_params['caseDocumentId'] = case_document_id + # process the query parameters + if is_preview_document is not None: + + _query_params.append(('isPreviewDocument', is_preview_document)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseDocumentDownload/{caseDocumentId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_case_document_order_callback_by_id( + self, + case_document_order_callback_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Unique Id for the Case Document Order Callback.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseDocumentOrderCallback: + """Get Case Document Order Callback for a requested Case Document Order Callback Id. + + Get Case Document Order Callback for a requested Case Document Order Callback Id. + + :param case_document_order_callback_id: Unique Id for the Case Document Order Callback. (required) + :type case_document_order_callback_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_document_order_callback_by_id_serialize( + case_document_order_callback_id=case_document_order_callback_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocumentOrderCallback", + '404': "Exception", + '451': "CaseDocumentOrderCallback", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_document_order_callback_by_id_with_http_info( + self, + case_document_order_callback_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Unique Id for the Case Document Order Callback.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseDocumentOrderCallback]: + """Get Case Document Order Callback for a requested Case Document Order Callback Id. + + Get Case Document Order Callback for a requested Case Document Order Callback Id. + + :param case_document_order_callback_id: Unique Id for the Case Document Order Callback. (required) + :type case_document_order_callback_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_document_order_callback_by_id_serialize( + case_document_order_callback_id=case_document_order_callback_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocumentOrderCallback", + '404': "Exception", + '451': "CaseDocumentOrderCallback", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_document_order_callback_by_id_without_preload_content( + self, + case_document_order_callback_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Unique Id for the Case Document Order Callback.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Case Document Order Callback for a requested Case Document Order Callback Id. + + Get Case Document Order Callback for a requested Case Document Order Callback Id. + + :param case_document_order_callback_id: Unique Id for the Case Document Order Callback. (required) + :type case_document_order_callback_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_document_order_callback_by_id_serialize( + case_document_order_callback_id=case_document_order_callback_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocumentOrderCallback", + '404': "Exception", + '451': "CaseDocumentOrderCallback", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_document_order_callback_by_id_serialize( self, case_document_order_callback_id, - **kwargs - ): - """Get Case Document Order Callback for a requested Case Document Order Callback Id. # noqa: E501 - - Get Case Document Order Callback for a requested Case Document Order Callback Id. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_document_order_callback_by_id(case_document_order_callback_id, async_req=True) - >>> result = thread.get() - - Args: - case_document_order_callback_id (str): Unique Id for the Case Document Order Callback. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseDocumentOrderCallback - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_document_order_callback_id'] = \ - case_document_order_callback_id - return self.get_case_document_order_callback_by_id_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_document_order_callback_id is not None: + _path_params['caseDocumentOrderCallbackId'] = case_document_order_callback_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseDocumentOrder/callbacks/{caseDocumentOrderCallbackId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_document_order_callbacks( self, - **kwargs - ): - """Get Case Document Order Callback list for a requested Date. # noqa: E501 - - Get Case Document Order Callback list for a requested Date. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_document_order_callbacks(async_req=True) - >>> result = thread.get() - - - Keyword Args: - date (datetime): Date for which fetch the Case Document Order Callback list. By default, the date will be set to current date.. [optional] - status (str): Status of Document Order callbacks. Default status will fetch all callbacks.. [optional] - page_number (int): Page to fetch the Case Document Order Callback list.
- Minimum: 1 . [optional] if omitted the server will use the default value of 1 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseDocumentOrderCallbackListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_document_order_callbacks_endpoint.call_with_http_info(**kwargs) + date: Annotated[Optional[datetime], Field(description="Date for which fetch the Case Document Order Callback list. By default, the date will be set to current date.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of Document Order callbacks. Default status will fetch all callbacks.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page to fetch the Case Document Order Callback list.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseDocumentOrderCallbackListResponse: + """Get Case Document Order Callback list for a requested Date. + + Get Case Document Order Callback list for a requested Date. + + :param date: Date for which fetch the Case Document Order Callback list. By default, the date will be set to current date. + :type date: datetime + :param status: Status of Document Order callbacks. Default status will fetch all callbacks. + :type status: str + :param page_number: Page to fetch the Case Document Order Callback list.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_document_order_callbacks_serialize( + date=date, + status=status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocumentOrderCallbackListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_document_order_callbacks_with_http_info( + self, + date: Annotated[Optional[datetime], Field(description="Date for which fetch the Case Document Order Callback list. By default, the date will be set to current date.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of Document Order callbacks. Default status will fetch all callbacks.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page to fetch the Case Document Order Callback list.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseDocumentOrderCallbackListResponse]: + """Get Case Document Order Callback list for a requested Date. + + Get Case Document Order Callback list for a requested Date. + + :param date: Date for which fetch the Case Document Order Callback list. By default, the date will be set to current date. + :type date: datetime + :param status: Status of Document Order callbacks. Default status will fetch all callbacks. + :type status: str + :param page_number: Page to fetch the Case Document Order Callback list.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_document_order_callbacks_serialize( + date=date, + status=status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocumentOrderCallbackListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_document_order_callbacks_without_preload_content( + self, + date: Annotated[Optional[datetime], Field(description="Date for which fetch the Case Document Order Callback list. By default, the date will be set to current date.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of Document Order callbacks. Default status will fetch all callbacks.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page to fetch the Case Document Order Callback list.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Case Document Order Callback list for a requested Date. + + Get Case Document Order Callback list for a requested Date. + + :param date: Date for which fetch the Case Document Order Callback list. By default, the date will be set to current date. + :type date: datetime + :param status: Status of Document Order callbacks. Default status will fetch all callbacks. + :type status: str + :param page_number: Page to fetch the Case Document Order Callback list.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_document_order_callbacks_serialize( + date=date, + status=status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocumentOrderCallbackListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_document_order_callbacks_serialize( + self, + date, + status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if date is not None: + if isinstance(date, datetime): + _query_params.append( + ( + 'date', + date + ) + ) + else: + _query_params.append(('date', date)) + + if status is not None: + + _query_params.append(('status', status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseDocumentOrder/callbacks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_case_documents( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Case ID for which you want the data for.")], + in_library: Annotated[Optional[StrictBool], Field(description="Filter all the documents those are added to the UniCourt library.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Get all the documents which were added to the case on or after a specific date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Sort all the documents based on the date when the document was added to the UniCourt Library.")] = None, + first_fetch_date: Annotated[Optional[datetime], Field(description="Sort all the documents based on the date it was fetched from the source site.")] = None, + sort_by: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=20)]], Field(description="Sort documents with document order.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page for which the result should be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseDocuments: + """Gets Documents for a requested Case ID. + + Gets Documents for a requested Case ID. + + :param case_id: Case ID for which you want the data for. (required) + :type case_id: str + :param in_library: Filter all the documents those are added to the UniCourt library. + :type in_library: bool + :param after_first_fetch_date: Get all the documents which were added to the case on or after a specific date. + :type after_first_fetch_date: datetime + :param library_date: Sort all the documents based on the date when the document was added to the UniCourt Library. + :type library_date: datetime + :param first_fetch_date: Sort all the documents based on the date it was fetched from the source site. + :type first_fetch_date: datetime + :param sort_by: Sort documents with document order. + :type sort_by: str + :param page_number: The page for which the result should be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_documents_serialize( + case_id=case_id, + in_library=in_library, + after_first_fetch_date=after_first_fetch_date, + library_date=library_date, + first_fetch_date=first_fetch_date, + sort_by=sort_by, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocuments", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_documents_with_http_info( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Case ID for which you want the data for.")], + in_library: Annotated[Optional[StrictBool], Field(description="Filter all the documents those are added to the UniCourt library.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Get all the documents which were added to the case on or after a specific date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Sort all the documents based on the date when the document was added to the UniCourt Library.")] = None, + first_fetch_date: Annotated[Optional[datetime], Field(description="Sort all the documents based on the date it was fetched from the source site.")] = None, + sort_by: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=20)]], Field(description="Sort documents with document order.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page for which the result should be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseDocuments]: + """Gets Documents for a requested Case ID. + + Gets Documents for a requested Case ID. + + :param case_id: Case ID for which you want the data for. (required) + :type case_id: str + :param in_library: Filter all the documents those are added to the UniCourt library. + :type in_library: bool + :param after_first_fetch_date: Get all the documents which were added to the case on or after a specific date. + :type after_first_fetch_date: datetime + :param library_date: Sort all the documents based on the date when the document was added to the UniCourt Library. + :type library_date: datetime + :param first_fetch_date: Sort all the documents based on the date it was fetched from the source site. + :type first_fetch_date: datetime + :param sort_by: Sort documents with document order. + :type sort_by: str + :param page_number: The page for which the result should be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_documents_serialize( + case_id=case_id, + in_library=in_library, + after_first_fetch_date=after_first_fetch_date, + library_date=library_date, + first_fetch_date=first_fetch_date, + sort_by=sort_by, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocuments", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_documents_without_preload_content( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Case ID for which you want the data for.")], + in_library: Annotated[Optional[StrictBool], Field(description="Filter all the documents those are added to the UniCourt library.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Get all the documents which were added to the case on or after a specific date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Sort all the documents based on the date when the document was added to the UniCourt Library.")] = None, + first_fetch_date: Annotated[Optional[datetime], Field(description="Sort all the documents based on the date it was fetched from the source site.")] = None, + sort_by: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=20)]], Field(description="Sort documents with document order.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page for which the result should be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets Documents for a requested Case ID. + + Gets Documents for a requested Case ID. + + :param case_id: Case ID for which you want the data for. (required) + :type case_id: str + :param in_library: Filter all the documents those are added to the UniCourt library. + :type in_library: bool + :param after_first_fetch_date: Get all the documents which were added to the case on or after a specific date. + :type after_first_fetch_date: datetime + :param library_date: Sort all the documents based on the date when the document was added to the UniCourt Library. + :type library_date: datetime + :param first_fetch_date: Sort all the documents based on the date it was fetched from the source site. + :type first_fetch_date: datetime + :param sort_by: Sort documents with document order. + :type sort_by: str + :param page_number: The page for which the result should be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_documents_serialize( + case_id=case_id, + in_library=in_library, + after_first_fetch_date=after_first_fetch_date, + library_date=library_date, + first_fetch_date=first_fetch_date, + sort_by=sort_by, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocuments", + '400': "Exception", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_documents_serialize( self, case_id, - **kwargs - ): - """Gets Documents for a requested Case ID. # noqa: E501 - - Gets Documents for a requested Case ID. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_documents(case_id, async_req=True) - >>> result = thread.get() - - Args: - case_id (str): Case ID for which you want the data for. - - Keyword Args: - in_library (bool): Filter all the documents those are added to the UniCourt library.. [optional] - after_first_fetch_date (datetime, none_type): Get all the documents which were added to the case on or after a specific date.. [optional] - library_date (datetime, none_type): Sort all the documents based on the date when the document was added to the UniCourt Library.. [optional] - first_fetch_date (datetime, none_type): Sort all the documents based on the date it was fetched from the source site.. [optional] - sort_by (str): Sort documents with document order.. [optional] - page_number (int): The page for which the result should be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseDocuments - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_id'] = \ - case_id - return self.get_case_documents_endpoint.call_with_http_info(**kwargs) + in_library, + after_first_fetch_date, + library_date, + first_fetch_date, + sort_by, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_id is not None: + _path_params['caseId'] = case_id + # process the query parameters + if in_library is not None: + + _query_params.append(('inLibrary', in_library)) + + if after_first_fetch_date is not None: + if isinstance(after_first_fetch_date, datetime): + _query_params.append( + ( + 'afterFirstFetchDate', + after_first_fetch_date + ) + ) + else: + _query_params.append(('afterFirstFetchDate', after_first_fetch_date)) + + if library_date is not None: + if isinstance(library_date, datetime): + _query_params.append( + ( + 'libraryDate', + library_date + ) + ) + else: + _query_params.append(('libraryDate', library_date)) + + if first_fetch_date is not None: + if isinstance(first_fetch_date, datetime): + _query_params.append( + ( + 'firstFetchDate', + first_fetch_date + ) + ) + else: + _query_params.append(('firstFetchDate', first_fetch_date)) + + if sort_by is not None: + + _query_params.append(('sortBy', sort_by)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/case/{caseId}/documents', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_document_by_id( + self, + case_document_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Specific Case Dcoument ID for which you want the data for.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseDocument: + """Gets details for a requested Document ID. + + Gets details for a requested Document ID. + + :param case_document_id: Specific Case Dcoument ID for which you want the data for. (required) + :type case_document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_document_by_id_serialize( + case_document_id=case_document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocument", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_document_by_id_with_http_info( + self, + case_document_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Specific Case Dcoument ID for which you want the data for.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseDocument]: + """Gets details for a requested Document ID. + + Gets details for a requested Document ID. + + :param case_document_id: Specific Case Dcoument ID for which you want the data for. (required) + :type case_document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_document_by_id_serialize( + case_document_id=case_document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocument", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_document_by_id_without_preload_content( + self, + case_document_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Specific Case Dcoument ID for which you want the data for.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets details for a requested Document ID. + + Gets details for a requested Document ID. + + :param case_document_id: Specific Case Dcoument ID for which you want the data for. (required) + :type case_document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_document_by_id_serialize( + case_document_id=case_document_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocument", + '404': "Exception", + '451': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_document_by_id_serialize( self, case_document_id, - **kwargs - ): - """Gets details for a requested Document ID. # noqa: E501 - - Gets details for a requested Document ID. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_document_by_id(case_document_id, async_req=True) - >>> result = thread.get() - - Args: - case_document_id (str): Specific Case Dcoument ID for which you want the data for. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseDocument - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_document_id'] = \ - case_document_id - return self.get_document_by_id_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_document_id is not None: + _path_params['caseDocumentId'] = case_document_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseDocument/{caseDocumentId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def order_case_document( self, - **kwargs - ): - """Add Case Document Order for requested Document Ids. # noqa: E501 - - Add Case Document Order for requested Document Ids. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.order_case_document(async_req=True) - >>> result = thread.get() - - - Keyword Args: - case_document_order_request (CaseDocumentOrderRequest): If the Case Document Order is for Preview, then the value for ``isPreviewOnly`` should be ``true`` else ``false``. . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseDocumentOrderCallback - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.order_case_document_endpoint.call_with_http_info(**kwargs) + case_document_order_request: Annotated[Optional[CaseDocumentOrderRequest], Field(description="If the Case Document Order is for Preview, then the value for ``isPreviewOnly`` should be ``true`` else ``false``. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseDocumentOrderCallback: + """Add Case Document Order for requested Document Ids. + + Add Case Document Order for requested Document Ids. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. The progress of this Case Document Order request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_document_order_request: If the Case Document Order is for Preview, then the value for ``isPreviewOnly`` should be ``true`` else ``false``. + :type case_document_order_request: CaseDocumentOrderRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._order_case_document_serialize( + case_document_order_request=case_document_order_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocumentOrderCallback", + '400': "Exception", + '402': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def order_case_document_with_http_info( + self, + case_document_order_request: Annotated[Optional[CaseDocumentOrderRequest], Field(description="If the Case Document Order is for Preview, then the value for ``isPreviewOnly`` should be ``true`` else ``false``. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseDocumentOrderCallback]: + """Add Case Document Order for requested Document Ids. + + Add Case Document Order for requested Document Ids. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. The progress of this Case Document Order request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_document_order_request: If the Case Document Order is for Preview, then the value for ``isPreviewOnly`` should be ``true`` else ``false``. + :type case_document_order_request: CaseDocumentOrderRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._order_case_document_serialize( + case_document_order_request=case_document_order_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocumentOrderCallback", + '400': "Exception", + '402': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def order_case_document_without_preload_content( + self, + case_document_order_request: Annotated[Optional[CaseDocumentOrderRequest], Field(description="If the Case Document Order is for Preview, then the value for ``isPreviewOnly`` should be ``true`` else ``false``. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add Case Document Order for requested Document Ids. + + Add Case Document Order for requested Document Ids. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. The progress of this Case Document Order request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_document_order_request: If the Case Document Order is for Preview, then the value for ``isPreviewOnly`` should be ``true`` else ``false``. + :type case_document_order_request: CaseDocumentOrderRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._order_case_document_serialize( + case_document_order_request=case_document_order_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseDocumentOrderCallback", + '400': "Exception", + '402': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _order_case_document_serialize( + self, + case_document_order_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if case_document_order_request is not None: + _body_params = case_document_order_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/caseDocumentOrder', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + diff --git a/unicourt/api/case_export_api.py b/unicourt/api/case_export_api.py index c273e48..0da07d6 100644 --- a/unicourt/api/case_export_api.py +++ b/unicourt/api/case_export_api.py @@ -1,480 +1,870 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from datetime import datetime +from pydantic import Field, field_validator +from typing import Optional +from typing_extensions import Annotated from unicourt.model.case_export_callback import CaseExportCallback from unicourt.model.case_export_callback_list_response import CaseExportCallbackListResponse -from unicourt.model.exception import Exception + +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType -class CaseExportApi(object): +class CaseExportApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.export_case_endpoint = _Endpoint( - settings={ - 'response_type': (CaseExportCallback,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseExport/{caseId}', - 'operation_id': 'export_case', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - ], - 'required': [ - 'case_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_id', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_id': - (str,), - }, - 'attribute_map': { - 'case_id': 'caseId', - }, - 'location_map': { - 'case_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_export_callback_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (CaseExportCallback,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseExport/callbacks/{caseExportCallbackId}', - 'operation_id': 'get_case_export_callback_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_export_callback_id', - ], - 'required': [ - 'case_export_callback_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_export_callback_id', - ] - }, - root_map={ - 'validations': { - ('case_export_callback_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_export_callback_id': - (str,), - }, - 'attribute_map': { - 'case_export_callback_id': 'caseExportCallbackId', - }, - 'location_map': { - 'case_export_callback_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + + @validate_call + def export_case( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value of the case for which case export information is to be retrieved. The progress of this Case Export request is available via web socket messages documented on WebSocket Callbacks Documentation ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseExportCallback: + """Gets case exported for a requested Case ID. + + Retrieve information about the specified case export. + + :param case_id: The caseId value of the case for which case export information is to be retrieved. The progress of this Case Export request is available via web socket messages documented on WebSocket Callbacks Documentation (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_case_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.get_case_export_callbacks_endpoint = _Endpoint( - settings={ - 'response_type': (CaseExportCallbackListResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseExport/callbacks', - 'operation_id': 'get_case_export_callbacks', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'date', - 'status', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'status', - ], - 'validation': [ - 'date', - 'status', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('status',): { - 'max_length': 11, - 'min_length': 7, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - ('status',): { - - "IN_PROGRESS": "IN_PROGRESS", - "COMPLETE": "COMPLETE", - "FAILURE": "FAILURE" - }, - }, - 'openapi_types': { - 'date': - (datetime,), - 'status': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'date': 'date', - 'status': 'status', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'date': 'query', - 'status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseExportCallback", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data - def export_case( + + @validate_call + def export_case_with_http_info( self, - case_id, - **kwargs - ): - """Gets case exported for a requested Case ID. # noqa: E501 - - Retrieve information about the specified case export. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.export_case(case_id, async_req=True) - >>> result = thread.get() - - Args: - case_id (str): The caseId value of the case for which case export information is to be retrieved. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseExportCallback - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value of the case for which case export information is to be retrieved. The progress of this Case Export request is available via web socket messages documented on WebSocket Callbacks Documentation ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseExportCallback]: + """Gets case exported for a requested Case ID. + + Retrieve information about the specified case export. + + :param case_id: The caseId value of the case for which case export information is to be retrieved. The progress of this Case Export request is available via web socket messages documented on WebSocket Callbacks Documentation (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_case_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseExportCallback", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + + @validate_call + def export_case_without_preload_content( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value of the case for which case export information is to be retrieved. The progress of this Case Export request is available via web socket messages documented on WebSocket Callbacks Documentation ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets case exported for a requested Case ID. + + Retrieve information about the specified case export. + + :param case_id: The caseId value of the case for which case export information is to be retrieved. The progress of this Case Export request is available via web socket messages documented on WebSocket Callbacks Documentation (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_case_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseExportCallback", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + return response_data.response + + + def _export_case_serialize( + self, + case_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_id is not None: + _path_params['caseId'] = case_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseExport/{caseId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_id'] = \ - case_id - return self.export_case_endpoint.call_with_http_info(**kwargs) + + + + @validate_call def get_case_export_callback_by_id( self, - case_export_callback_id, - **kwargs - ): - """Get Case Export Callback for a requested Case Export Callback Id. # noqa: E501 - - Retrieve the specified case export callback object. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_export_callback_by_id(case_export_callback_id, async_req=True) - >>> result = thread.get() - - Args: - case_export_callback_id (str): The caseExportCallbackId value of the case export callback object to be retrieved. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseExportCallback - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_export_callback_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseExportCallbackId value of the case export callback object to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseExportCallback: + """Get Case Export Callback for a requested Case Export Callback Id. + + Retrieve the specified case export callback object. + + :param case_export_callback_id: The caseExportCallbackId value of the case export callback object to be retrieved. (required) + :type case_export_callback_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_export_callback_by_id_serialize( + case_export_callback_id=case_export_callback_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseExportCallback", + '404': "Exception", + '451': "CaseExportCallback", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_export_callback_by_id_with_http_info( + self, + case_export_callback_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseExportCallbackId value of the case export callback object to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseExportCallback]: + """Get Case Export Callback for a requested Case Export Callback Id. + + Retrieve the specified case export callback object. + + :param case_export_callback_id: The caseExportCallbackId value of the case export callback object to be retrieved. (required) + :type case_export_callback_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_export_callback_by_id_serialize( + case_export_callback_id=case_export_callback_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseExportCallback", + '404': "Exception", + '451': "CaseExportCallback", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def get_case_export_callback_by_id_without_preload_content( + self, + case_export_callback_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseExportCallbackId value of the case export callback object to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Case Export Callback for a requested Case Export Callback Id. + + Retrieve the specified case export callback object. + + :param case_export_callback_id: The caseExportCallbackId value of the case export callback object to be retrieved. (required) + :type case_export_callback_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_export_callback_by_id_serialize( + case_export_callback_id=case_export_callback_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseExportCallback", + '404': "Exception", + '451': "CaseExportCallback", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_export_callback_by_id_serialize( + self, + case_export_callback_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_export_callback_id is not None: + _path_params['caseExportCallbackId'] = case_export_callback_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseExport/callbacks/{caseExportCallbackId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_export_callback_id'] = \ - case_export_callback_id - return self.get_case_export_callback_by_id_endpoint.call_with_http_info(**kwargs) + + + + @validate_call def get_case_export_callbacks( self, - **kwargs - ): - """Get Case Export Callback list for a requested Date. # noqa: E501 - - Retrieve callbacks according to the specified criteria. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_export_callbacks(async_req=True) - >>> result = thread.get() - - - Keyword Args: - date (datetime): The date for which callbacks are to be retrieved.. [optional] - status (str): The status code of the callbacks to be retrieved.. [optional] - page_number (int): The page number of the callbacks to be retrieved.
- Minimum: 1 . [optional] if omitted the server will use the default value of 1 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseExportCallbackListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + date: Annotated[Optional[datetime], Field(description="The date for which callbacks are to be retrieved.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="The status code of the callbacks to be retrieved.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the callbacks to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseExportCallbackListResponse: + """Get Case Export Callback list for a requested Date. + + Retrieve callbacks according to the specified criteria. + + :param date: The date for which callbacks are to be retrieved. + :type date: datetime + :param status: The status code of the callbacks to be retrieved. + :type status: str + :param page_number: The page number of the callbacks to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_export_callbacks_serialize( + date=date, + status=status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseExportCallbackListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_export_callbacks_with_http_info( + self, + date: Annotated[Optional[datetime], Field(description="The date for which callbacks are to be retrieved.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="The status code of the callbacks to be retrieved.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the callbacks to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseExportCallbackListResponse]: + """Get Case Export Callback list for a requested Date. + + Retrieve callbacks according to the specified criteria. + + :param date: The date for which callbacks are to be retrieved. + :type date: datetime + :param status: The status code of the callbacks to be retrieved. + :type status: str + :param page_number: The page number of the callbacks to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_export_callbacks_serialize( + date=date, + status=status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseExportCallbackListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + + @validate_call + def get_case_export_callbacks_without_preload_content( + self, + date: Annotated[Optional[datetime], Field(description="The date for which callbacks are to be retrieved.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="The status code of the callbacks to be retrieved.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the callbacks to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Case Export Callback list for a requested Date. + + Retrieve callbacks according to the specified criteria. + + :param date: The date for which callbacks are to be retrieved. + :type date: datetime + :param status: The status code of the callbacks to be retrieved. + :type status: str + :param page_number: The page number of the callbacks to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_export_callbacks_serialize( + date=date, + status=status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseExportCallbackListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + return response_data.response + + + def _get_case_export_callbacks_serialize( + self, + date, + status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if date is not None: + if isinstance(date, datetime): + _query_params.append( + ( + 'date', + date + ) + ) + else: + _query_params.append(('date', date)) + + if status is not None: + + _query_params.append(('status', status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseExport/callbacks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_export_callbacks_endpoint.call_with_http_info(**kwargs) + diff --git a/unicourt/api/case_search_api.py b/unicourt/api/case_search_api.py index c6bbf61..b09cead 100644 --- a/unicourt/api/case_search_api.py +++ b/unicourt/api/case_search_api.py @@ -1,375 +1,634 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from pydantic import Field, field_validator +from typing import Optional +from typing_extensions import Annotated from unicourt.model.case_search_response import CaseSearchResponse -from unicourt.model.exception import Exception +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType -class CaseSearchApi(object): + +class CaseSearchApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.search_cases_endpoint = _Endpoint( - settings={ - 'response_type': (CaseSearchResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseSearch', - 'operation_id': 'search_cases', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'sort', - 'order', - 'page_number', - ], - 'required': [ - 'q', - ], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'sort', - 'order', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('sort',): { - 'max_length': 9, - 'min_length': 9, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 1000, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - ('sort',): { - - "FILEDDATE": "filedDate", - "RELEVANCY": "relevancy" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'sort': - (str,), - 'order': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'sort': 'sort', - 'order': 'order', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'sort': 'query', - 'order': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + + @validate_call + def search_cases( + self, + q: Annotated[str, Field(min_length=3, strict=True, max_length=2000, description="Query parameter for keyword expressions. ")], + sort: Annotated[Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]], Field(description="Query parameter specifying how results are to be sorted. Results can be sorted according to filedDate or relevancy.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Query parameter specifying whether search result are sorted in ascending or descending order.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseSearchResponse: + """Case search. + + This endpoint retrieves cases according to keyword expressions you provide.
Keyword expressions are constructed according to the rules described below.

This API supports multiple use cases: - Search for multiple keywords `Google OR Facebook`. - Search within particular attributes. - Relational search using terms and connectors. - And much more. ---- ## Allowed Connectors in Keyword Expressions | Connector | Description | Example | | ------| ------|------| | **AND** |Find cases containing each of the terms joined by AND connectors.|**personal AND injury**| | **OR** |Find cases containing any of the terms joined by OR connectors.|**order OR decision**| | **NOT** |Find cases that do not contain the specified term.|**personal AND NOT injury**. Find cases with the word “personal” and not “injury”.| | **“[phrase]”** |Find the exact phrase placed between the quotation marks.|**\"personal injury”**| | **~** |Find cases in which the specified words appear near each other. For example, \"personal injury\" ~ 5 targets cases in which the word \"personal\" appears within 5 words of the word \"injury\".|**“personal injury” ~ 5** - Find cases with “personal” within five words of “injury”. | | **( … )** |Specifies the order in which connectors are to be appliied in a keyword expression.| **personal AND (injury OR fall)** - Find cases with the word personal injury or personal fall.|

## Fields and Connectors Searching | Filed | Description | Example | | ------| ------|------| |**caseNumber** |Find cases with the specified case number (i.e., docket number).| **caseNumber:\"2020-L-007212\"** - Find cases whose case number matches given case number number.| |**caseName** |Find cases with the specified case title.| **caseName:\"THOMAS P. CARNEY, INC. VS BEHLER JAMES Et Al\"** - Find cases whose case name matches given terms.| |**Court**|Find cases in the specified court.|**(Court:(name:(New York)))** - Find cases in New York state.
| |**CaseStatus**|Find cases witih the specified case status.|**(CaseStatus:(name:Disposed))** - All disposed cases.
| |**CaseType**|Find cases of the specified case type. | **(CaseType:(name:Property))** - Cases with case type “property”.| |**Party** | Find cases involving the specified party.| **(Party:(name:Apple))** - Find cases involving Apple. | |**partyId**|Find cases involving a party with the specified partyId value.|**(Party:(partyId:\"PRTYgu1ffe866484c2\"))**| |**PartyRole** | Find cases in which at least one party has the specified party role. | **(Party:((PartyRole:(name:\"plaintiff\"))))** - Find cases with party role “plaintiff”.

**(Party:((PartyRole:(name:defendant)) AND (AttorneyRepresentationType:(name:(Attorney represented)))))** - Find cases where a party is acting as defendant and represented by an attorney.| |**AttorneyRepresentationType**| Find cases in which at least one party has the specified attorney representation type.|**(Party:(AttorneyRepresentationType:(name:\"attorney represented\")))** - Find cases where a party is represented by an attorney. | |**Attorney** | Find cases involving the specified attorney. | **(Attorney:(name:\"David Boies\"))** - Find cases involving the attorney David Boies. | |**AttorneyType**|Find cases involving at least one attorney of the specified attorney type.|**(Attorney:((AttorneyType:(name:\"Lead Attorney\"))))**| |**Judge** |Find cases involving the specified judge. | **(Judge:(name:\"Posner\"))** - Find cases involving Judge Posner.| |**JudgeType**|Find cases involving at least one judge of the specified judge type.|**(Judge:((JudgeType:(name:\"Magistrate\"))))**| |**CaseStats**|Find cases with the specified case statistics.|**(CaseStats:(partyCount:[10 TO 100]))** - Find cases involving 10 to 100 parties.
**(CaseStats:(attorneyCount:[2 TO 40]))** - Find cases involving 2 to 40 attorneys.
**(CaseStats:(judgeCount:[\\* TO 2]))** - Find cases involving up to 2 judges.
**(CaseStats:(docketEntryCount:[10 TO 100]))** - Find cases having 10 to 100 docket_entries.
**(CaseStats:(allCaseDocumentCount:[10 TO 100]))** - Find cases having 10 to 100 documents. | |**filedDate** | Find cases that were filed on the specified date or within the specified date range. | **filedDate:[2020-03-15 TO 2021-12-01]** - Find the most recently filed cases between March 15, 2020 and December 1, 2021 (inclusive). | |**lastFetchDate**| Find cases in which UniCourt last checked for updates on the specified date or within the specified date range. |**(lastFetchDate:[now-60d TO \\*\\])** - Find cases that were updated by UniCourt in the last 60 days. | |**lastFetchDateWithUpdates**|Find cases in which UniCourt last detected an update on the specified date or within the specified date range.|**(lastFetchDateWithUpdates:[now-6d TO \\*\\])** - Find cases for the changes found on court site in last 6 days.| |**participantsLastFetchDate**|Find cases in which information cocnerning participants was last updated on the specified date or within the specified date range.|**(participantsLastFetchDate:[now-6d TO \\*\\])** - Find cases where the participant's information was updated in last 6 days.| |**DocketEntry**|Find cases in which at least one docket entry contains the specified text.|**(DocketEntry:(text:(Motion to Compel Responses) AND docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00]))** - Find cases with docket text “Motion to Compel Responses” and action date between 2020-01-01 and 2020-05-01.| |**docketEntryDate**|Find cases in which at least one docket entry was made on the specified date or within the specified date range.|**(DocketEntry:(docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00])) AND (CaseStats:(allCaseDocumentCount:[0 TO 10]))** - Find cases with docket action date between 2020-01-01 and 2020-05-01 having up to 10 documents associated with it.| |**HearingDate**| Find cases with at least one hearing scheduled for the specified date or within the specified date range.|**(Hearing:(hearingDate:[now TO now+10d]))** - Find cases where hearing is scheduled in next 10 days.| |**HearingDate**| Search for cases where hearing is going to happen in 10 to 20days.|**(Hearing:(hearingDate:[now+10d TO now+20d]))** - Find cases where hearing is scheduled in next 10 to 20 days.| |**JurisdictionGeo**|Find cases in which the law of the specified state governs.|**(JurisdictionGeo:(state:\"New York\"))**- Find cases where Jurisdiction is New York state.| |**Party Address Exists**|Find cases with Party addresses.|**(Party:(Contact:(Address:(stateName:\\*))))**- Returns only those cases that have addresses for parties.| |**Document**|Find cases with specific document name and preview is available for the document.|**(CaseDocument:(name:\"civil case cover sheet\" AND isPreviewAvailable:true))**- Returns cases with document civil case cover sheet and preview is available.|

--- ## Party Sub Filter Examples |Example |Explanation | |---|---| |**(Party:(name:google AND (PartyRole:(name:\"plaintiff\"))))**|Find cases involving at least one plaintiff whose name contains the term \"Google\".| |**(Party:(name:\"OTELIA PEREIDA\" AND (AttorneyRepresentationType:(name:\"Attorney represented\")))) AND (Attorney:(name:\"Law Offices of Todd M Friedman\"))**|Find cases where the Party is *OTELIA PEREIDA* and is represented by the attorney *Law Offices of Todd M Friedman*.| --- ### All query parameters supported for this API can be found in below schema section. Schema --> CaseSearchQueryObject + + :param q: Query parameter for keyword expressions. (required) + :type q: str + :param sort: Query parameter specifying how results are to be sorted. Results can be sorted according to filedDate or relevancy. + :type sort: str + :param order: Query parameter specifying whether search result are sorted in ascending or descending order. + :type order: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_cases_serialize( + q=q, + sort=sort, + order=order, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.search_cases_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (CaseSearchResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseSearch/{caseSearchId}', - 'operation_id': 'search_cases_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_search_id', - 'page_number', - ], - 'required': [ - 'case_search_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_search_id', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('case_search_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('page_number',): { - - 'inclusive_maximum': 1000, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_search_id': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'case_search_id': 'caseSearchId', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'case_search_id': 'path', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseSearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data - def search_cases( + + @validate_call + def search_cases_with_http_info( self, - q, - **kwargs - ): - """Case search. # noqa: E501 - - This endpoint retrieves cases according to keyword expressions you provide.
Keyword expressions are constructed according to the rules described below.

This API supports multiple use cases: - Search for multiple keywords `Google OR Facebook`. - Search within particular attributes. - Relational search using terms and connectors. - And much more. ---- ## Allowed Connectors in Keyword Expressions | Connector | Description | Example | | ------| ------|------| | **AND** |Find cases containing each of the terms joined by AND connectors.|**personal AND injury**| | **OR** |Find cases containing any of the terms joined by OR connectors.|**order OR decision**| | **NOT** |Find cases that do not contain the specified term.|**personal AND NOT injury**. Find cases with the word “personal” and not “injury”.| | **“[phrase]”** |Find the exact phrase placed between the quotation marks.|**\"personal injury”**| | **~** |Find cases in which the specified words appear near each other. For example, \"personal injury\" ~ 5 targets cases in which the word \"personal\" appears within 5 words of the word \"injury\".|**“personal injury” ~ 5** - Find cases with “personal” within five words of “injury”. | | **( … )** |Specifies the order in which connectors are to be appliied in a keyword expression.| **personal AND (injury OR fall)** - Find cases with the word personal injury or personal fall.|

## Fields and Connectors Searching | Filed | Description | Example | | ------| ------|------| |**caseNumber** |Find cases with the specified case number (i.e., docket number).| **caseNumber:\"2020-L-007212\"** - Find cases whose case number matches given case number number.| |**caseName** |Find cases with the specified case title.| **caseName:\"THOMAS P. CARNEY, INC. VS BEHLER JAMES Et Al\"** - Find cases whose case name matches given terms.| |**Court**|Find cases in the specified court.|**(Court:(name:(New York)))** - Find cases in New York state.
| |**CaseStatus**|Find cases witih the specified case status.|**(CaseStatus:(name:Disposed))** - All disposed cases.
| |**CaseType**|Find cases of the specified case type. | **(CaseType:(name:Property))** - Cases with case type “property”.| |**Party** | Find cases involving the specified party.| **(Party:(name:Apple))** - Find cases involving Apple. | |**partyId**|Find cases involving a party with the specified partyId value.|**(Party:(partyId:\"PRTYgu1ffe866484c2\"))**| |**PartyRole** | Find cases in which at least one party has the specified party role. | **(Party:((PartyRole:(name:\"plaintiff\"))))** - Find cases with party role “plaintiff”.

**(Party:((PartyRole:(name:defendant)) AND (AttorneyRepresentationType:(name:(Attorney represented)))))** - Find cases where a party is acting as defendant and represented by an attorney.| |**AttorneyRepresentationType**| Find cases in which at least one party has the specified attorney representation type.|**(Party:(AttorneyRepresentationType:(name:\"attorney represented\")))** - Find cases where a party is represented by an attorney. | |**Attorney** | Find cases involving the specified attorney. | **(Attorney:(name:\"David Boies\"))** - Find cases involving the attorney David Boies. | |**AttorneyType**|Find cases involving at least one attorney of the specified attorney type.|**(Attorney:((AttorneyType:(name:\"Lead Attorney\"))))**| |**Judge** |Find cases involving the specified judge. | **(Judge:(name:\"Posner\"))** - Find cases involving Judge Posner.| |**JudgeType**|Find cases involving at least one judge of the specified judge type.|**(Judge:((JudgeType:(name:\"Magistrate\"))))**| |**CaseStats**|Find cases with the specified case statistics.|**(CaseStats:(partyCount:[10 TO 100]))** - Find cases involving 10 to 100 parties.
**(CaseStats:(attorneyCount:[2 TO 40]))** - Find cases involving 2 to 40 attorneys.
**(CaseStats:(judgeCount:[\\* TO 2]))** - Find cases involving up to 2 judges.
**(CaseStats:(docketEntryCount:[10 TO 100]))** - Find cases having 10 to 100 docket_entries.
**(CaseStats:(allCaseDocumentCount:[10 TO 100]))** - Find cases having 10 to 100 documents. | |**filedDate** | Find cases that were filed on the specified date or within the specified date range. | **filedDate:[2020-03-15T00:00:00 TO 2021-12-01T00:00:00]** - Find the most recently filed cases between March 15, 2020 and December 1, 2021 (inclusive). | |**lastFetchDate**| Find cases in which UniCourt last checked for updates on the specified date or within the specified date range. |**(lastFetchDate:[now-60d TO \\*\\])** - Find cases that were updated by UniCourt in the last 60 days. | |**lastFetchDateWithUpdates**|Find cases in which UniCourt last detected an update on the specified date or within the specified date range.|**(lastFetchDateWithUpdates:[now-6d TO \\*\\])** - Find cases for the changes found on court site in last 6 days.| |**participantsLastFetchDate**|Find cases in which information cocnerning participants was last updated on the specified date or within the specified date range.|**(participantsLastFetchDate:[now-6d TO \\*\\])** - Find cases where the participant's information was updated in last 6 days.| |**DocketEntry**|Find cases in which at least one docket entry contains the specified text.|**(DocketEntry:(text:(Motion to Compel Responses) AND docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00]))** - Find cases with docket text “Motion to Compel Responses” and action date between 2020-01-01 and 2020-05-01.| |**docketEntryDate**|Find cases in which at least one docket entry was made on the specified date or within the specified date range.|**(DocketEntry:(docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00])) AND (CaseStats:(allCaseDocumentCount:[0 TO 10]))** - Find cases with docket action date between 2020-01-01 and 2020-05-01 having up to 10 documents associated with it.| |**HearingDate**| Find cases with at least one hearing scheduled for the specified date or within the specified date range.|**(Hearing:(hearingDate:[now TO now+10d]))** - Find cases where hearing is scheduled in next 10 days.| |**HearingDate**| Search for cases where hearing is going to happen in 10 to 20days.|**(Hearing:(hearingDate:[now+10d TO now+20d]))** - Find cases where hearing is scheduled in next 10 to 20 days.| |**JurisdictionGeo**|Find cases in which the law of the specified state governs.|**(JurisdictionGeo:(state:\"New York\"))**- Find cases where Jurisdiction is New York state.| |**Party Address Exists**|Find cases with Party addresses.|**(Party:(Contact:(Address:(stateName:\\*))))**- Returns only those cases that have addresses for parties.| |**Document**|Find cases with specific document name and preview is available for the document.|**(CaseDocument:(name:\"civil case cover sheet\" AND isPreviewAvailable:true))**- Returns cases with document civil case cover sheet and preview is available.|

--- ## Party Sub Filter Examples |Example |Explanation | |---|---| |**(Party:(name:google AND (PartyRole:(name:\"plaintiff\"))))**|Find cases involving at least one plaintiff whose name contains the term \"Google\".| |**(Party:(name:\"OTELIA PEREIDA\" AND (AttorneyRepresentationType:(name:\"Attorney represented\")))) AND (Attorney:(name:\"Law Offices of Todd M Friedman\"))**|Find cases where the Party is *OTELIA PEREIDA* and is represented by the attorney *Law Offices of Todd M Friedman*.| --- ### All query parameters supported for this API can be found in below schema section. Schema --> CaseSearchQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.search_cases(q, async_req=True) - >>> result = thread.get() - - Args: - q (str): Query parameter for keyword expressions. - - Keyword Args: - sort (str): Query parameter specifying how results are to be sorted. Results can be sorted according to filedDate or relevancy.. [optional] if omitted the server will use the default value of "filedDate" - order (str): Query parameter specifying whether search result are sorted in ascending or descending order.. [optional] if omitted the server will use the default value of "desc" - page_number (int): The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseSearchResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + q: Annotated[str, Field(min_length=3, strict=True, max_length=2000, description="Query parameter for keyword expressions. ")], + sort: Annotated[Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]], Field(description="Query parameter specifying how results are to be sorted. Results can be sorted according to filedDate or relevancy.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Query parameter specifying whether search result are sorted in ascending or descending order.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseSearchResponse]: + """Case search. + + This endpoint retrieves cases according to keyword expressions you provide.
Keyword expressions are constructed according to the rules described below.

This API supports multiple use cases: - Search for multiple keywords `Google OR Facebook`. - Search within particular attributes. - Relational search using terms and connectors. - And much more. ---- ## Allowed Connectors in Keyword Expressions | Connector | Description | Example | | ------| ------|------| | **AND** |Find cases containing each of the terms joined by AND connectors.|**personal AND injury**| | **OR** |Find cases containing any of the terms joined by OR connectors.|**order OR decision**| | **NOT** |Find cases that do not contain the specified term.|**personal AND NOT injury**. Find cases with the word “personal” and not “injury”.| | **“[phrase]”** |Find the exact phrase placed between the quotation marks.|**\"personal injury”**| | **~** |Find cases in which the specified words appear near each other. For example, \"personal injury\" ~ 5 targets cases in which the word \"personal\" appears within 5 words of the word \"injury\".|**“personal injury” ~ 5** - Find cases with “personal” within five words of “injury”. | | **( … )** |Specifies the order in which connectors are to be appliied in a keyword expression.| **personal AND (injury OR fall)** - Find cases with the word personal injury or personal fall.|

## Fields and Connectors Searching | Filed | Description | Example | | ------| ------|------| |**caseNumber** |Find cases with the specified case number (i.e., docket number).| **caseNumber:\"2020-L-007212\"** - Find cases whose case number matches given case number number.| |**caseName** |Find cases with the specified case title.| **caseName:\"THOMAS P. CARNEY, INC. VS BEHLER JAMES Et Al\"** - Find cases whose case name matches given terms.| |**Court**|Find cases in the specified court.|**(Court:(name:(New York)))** - Find cases in New York state.
| |**CaseStatus**|Find cases witih the specified case status.|**(CaseStatus:(name:Disposed))** - All disposed cases.
| |**CaseType**|Find cases of the specified case type. | **(CaseType:(name:Property))** - Cases with case type “property”.| |**Party** | Find cases involving the specified party.| **(Party:(name:Apple))** - Find cases involving Apple. | |**partyId**|Find cases involving a party with the specified partyId value.|**(Party:(partyId:\"PRTYgu1ffe866484c2\"))**| |**PartyRole** | Find cases in which at least one party has the specified party role. | **(Party:((PartyRole:(name:\"plaintiff\"))))** - Find cases with party role “plaintiff”.

**(Party:((PartyRole:(name:defendant)) AND (AttorneyRepresentationType:(name:(Attorney represented)))))** - Find cases where a party is acting as defendant and represented by an attorney.| |**AttorneyRepresentationType**| Find cases in which at least one party has the specified attorney representation type.|**(Party:(AttorneyRepresentationType:(name:\"attorney represented\")))** - Find cases where a party is represented by an attorney. | |**Attorney** | Find cases involving the specified attorney. | **(Attorney:(name:\"David Boies\"))** - Find cases involving the attorney David Boies. | |**AttorneyType**|Find cases involving at least one attorney of the specified attorney type.|**(Attorney:((AttorneyType:(name:\"Lead Attorney\"))))**| |**Judge** |Find cases involving the specified judge. | **(Judge:(name:\"Posner\"))** - Find cases involving Judge Posner.| |**JudgeType**|Find cases involving at least one judge of the specified judge type.|**(Judge:((JudgeType:(name:\"Magistrate\"))))**| |**CaseStats**|Find cases with the specified case statistics.|**(CaseStats:(partyCount:[10 TO 100]))** - Find cases involving 10 to 100 parties.
**(CaseStats:(attorneyCount:[2 TO 40]))** - Find cases involving 2 to 40 attorneys.
**(CaseStats:(judgeCount:[\\* TO 2]))** - Find cases involving up to 2 judges.
**(CaseStats:(docketEntryCount:[10 TO 100]))** - Find cases having 10 to 100 docket_entries.
**(CaseStats:(allCaseDocumentCount:[10 TO 100]))** - Find cases having 10 to 100 documents. | |**filedDate** | Find cases that were filed on the specified date or within the specified date range. | **filedDate:[2020-03-15 TO 2021-12-01]** - Find the most recently filed cases between March 15, 2020 and December 1, 2021 (inclusive). | |**lastFetchDate**| Find cases in which UniCourt last checked for updates on the specified date or within the specified date range. |**(lastFetchDate:[now-60d TO \\*\\])** - Find cases that were updated by UniCourt in the last 60 days. | |**lastFetchDateWithUpdates**|Find cases in which UniCourt last detected an update on the specified date or within the specified date range.|**(lastFetchDateWithUpdates:[now-6d TO \\*\\])** - Find cases for the changes found on court site in last 6 days.| |**participantsLastFetchDate**|Find cases in which information cocnerning participants was last updated on the specified date or within the specified date range.|**(participantsLastFetchDate:[now-6d TO \\*\\])** - Find cases where the participant's information was updated in last 6 days.| |**DocketEntry**|Find cases in which at least one docket entry contains the specified text.|**(DocketEntry:(text:(Motion to Compel Responses) AND docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00]))** - Find cases with docket text “Motion to Compel Responses” and action date between 2020-01-01 and 2020-05-01.| |**docketEntryDate**|Find cases in which at least one docket entry was made on the specified date or within the specified date range.|**(DocketEntry:(docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00])) AND (CaseStats:(allCaseDocumentCount:[0 TO 10]))** - Find cases with docket action date between 2020-01-01 and 2020-05-01 having up to 10 documents associated with it.| |**HearingDate**| Find cases with at least one hearing scheduled for the specified date or within the specified date range.|**(Hearing:(hearingDate:[now TO now+10d]))** - Find cases where hearing is scheduled in next 10 days.| |**HearingDate**| Search for cases where hearing is going to happen in 10 to 20days.|**(Hearing:(hearingDate:[now+10d TO now+20d]))** - Find cases where hearing is scheduled in next 10 to 20 days.| |**JurisdictionGeo**|Find cases in which the law of the specified state governs.|**(JurisdictionGeo:(state:\"New York\"))**- Find cases where Jurisdiction is New York state.| |**Party Address Exists**|Find cases with Party addresses.|**(Party:(Contact:(Address:(stateName:\\*))))**- Returns only those cases that have addresses for parties.| |**Document**|Find cases with specific document name and preview is available for the document.|**(CaseDocument:(name:\"civil case cover sheet\" AND isPreviewAvailable:true))**- Returns cases with document civil case cover sheet and preview is available.|

--- ## Party Sub Filter Examples |Example |Explanation | |---|---| |**(Party:(name:google AND (PartyRole:(name:\"plaintiff\"))))**|Find cases involving at least one plaintiff whose name contains the term \"Google\".| |**(Party:(name:\"OTELIA PEREIDA\" AND (AttorneyRepresentationType:(name:\"Attorney represented\")))) AND (Attorney:(name:\"Law Offices of Todd M Friedman\"))**|Find cases where the Party is *OTELIA PEREIDA* and is represented by the attorney *Law Offices of Todd M Friedman*.| --- ### All query parameters supported for this API can be found in below schema section. Schema --> CaseSearchQueryObject + + :param q: Query parameter for keyword expressions. (required) + :type q: str + :param sort: Query parameter specifying how results are to be sorted. Results can be sorted according to filedDate or relevancy. + :type sort: str + :param order: Query parameter specifying whether search result are sorted in ascending or descending order. + :type order: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_cases_serialize( + q=q, + sort=sort, + order=order, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseSearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + + @validate_call + def search_cases_without_preload_content( + self, + q: Annotated[str, Field(min_length=3, strict=True, max_length=2000, description="Query parameter for keyword expressions. ")], + sort: Annotated[Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]], Field(description="Query parameter specifying how results are to be sorted. Results can be sorted according to filedDate or relevancy.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Query parameter specifying whether search result are sorted in ascending or descending order.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case search. + + This endpoint retrieves cases according to keyword expressions you provide.
Keyword expressions are constructed according to the rules described below.

This API supports multiple use cases: - Search for multiple keywords `Google OR Facebook`. - Search within particular attributes. - Relational search using terms and connectors. - And much more. ---- ## Allowed Connectors in Keyword Expressions | Connector | Description | Example | | ------| ------|------| | **AND** |Find cases containing each of the terms joined by AND connectors.|**personal AND injury**| | **OR** |Find cases containing any of the terms joined by OR connectors.|**order OR decision**| | **NOT** |Find cases that do not contain the specified term.|**personal AND NOT injury**. Find cases with the word “personal” and not “injury”.| | **“[phrase]”** |Find the exact phrase placed between the quotation marks.|**\"personal injury”**| | **~** |Find cases in which the specified words appear near each other. For example, \"personal injury\" ~ 5 targets cases in which the word \"personal\" appears within 5 words of the word \"injury\".|**“personal injury” ~ 5** - Find cases with “personal” within five words of “injury”. | | **( … )** |Specifies the order in which connectors are to be appliied in a keyword expression.| **personal AND (injury OR fall)** - Find cases with the word personal injury or personal fall.|

## Fields and Connectors Searching | Filed | Description | Example | | ------| ------|------| |**caseNumber** |Find cases with the specified case number (i.e., docket number).| **caseNumber:\"2020-L-007212\"** - Find cases whose case number matches given case number number.| |**caseName** |Find cases with the specified case title.| **caseName:\"THOMAS P. CARNEY, INC. VS BEHLER JAMES Et Al\"** - Find cases whose case name matches given terms.| |**Court**|Find cases in the specified court.|**(Court:(name:(New York)))** - Find cases in New York state.
| |**CaseStatus**|Find cases witih the specified case status.|**(CaseStatus:(name:Disposed))** - All disposed cases.
| |**CaseType**|Find cases of the specified case type. | **(CaseType:(name:Property))** - Cases with case type “property”.| |**Party** | Find cases involving the specified party.| **(Party:(name:Apple))** - Find cases involving Apple. | |**partyId**|Find cases involving a party with the specified partyId value.|**(Party:(partyId:\"PRTYgu1ffe866484c2\"))**| |**PartyRole** | Find cases in which at least one party has the specified party role. | **(Party:((PartyRole:(name:\"plaintiff\"))))** - Find cases with party role “plaintiff”.

**(Party:((PartyRole:(name:defendant)) AND (AttorneyRepresentationType:(name:(Attorney represented)))))** - Find cases where a party is acting as defendant and represented by an attorney.| |**AttorneyRepresentationType**| Find cases in which at least one party has the specified attorney representation type.|**(Party:(AttorneyRepresentationType:(name:\"attorney represented\")))** - Find cases where a party is represented by an attorney. | |**Attorney** | Find cases involving the specified attorney. | **(Attorney:(name:\"David Boies\"))** - Find cases involving the attorney David Boies. | |**AttorneyType**|Find cases involving at least one attorney of the specified attorney type.|**(Attorney:((AttorneyType:(name:\"Lead Attorney\"))))**| |**Judge** |Find cases involving the specified judge. | **(Judge:(name:\"Posner\"))** - Find cases involving Judge Posner.| |**JudgeType**|Find cases involving at least one judge of the specified judge type.|**(Judge:((JudgeType:(name:\"Magistrate\"))))**| |**CaseStats**|Find cases with the specified case statistics.|**(CaseStats:(partyCount:[10 TO 100]))** - Find cases involving 10 to 100 parties.
**(CaseStats:(attorneyCount:[2 TO 40]))** - Find cases involving 2 to 40 attorneys.
**(CaseStats:(judgeCount:[\\* TO 2]))** - Find cases involving up to 2 judges.
**(CaseStats:(docketEntryCount:[10 TO 100]))** - Find cases having 10 to 100 docket_entries.
**(CaseStats:(allCaseDocumentCount:[10 TO 100]))** - Find cases having 10 to 100 documents. | |**filedDate** | Find cases that were filed on the specified date or within the specified date range. | **filedDate:[2020-03-15 TO 2021-12-01]** - Find the most recently filed cases between March 15, 2020 and December 1, 2021 (inclusive). | |**lastFetchDate**| Find cases in which UniCourt last checked for updates on the specified date or within the specified date range. |**(lastFetchDate:[now-60d TO \\*\\])** - Find cases that were updated by UniCourt in the last 60 days. | |**lastFetchDateWithUpdates**|Find cases in which UniCourt last detected an update on the specified date or within the specified date range.|**(lastFetchDateWithUpdates:[now-6d TO \\*\\])** - Find cases for the changes found on court site in last 6 days.| |**participantsLastFetchDate**|Find cases in which information cocnerning participants was last updated on the specified date or within the specified date range.|**(participantsLastFetchDate:[now-6d TO \\*\\])** - Find cases where the participant's information was updated in last 6 days.| |**DocketEntry**|Find cases in which at least one docket entry contains the specified text.|**(DocketEntry:(text:(Motion to Compel Responses) AND docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00]))** - Find cases with docket text “Motion to Compel Responses” and action date between 2020-01-01 and 2020-05-01.| |**docketEntryDate**|Find cases in which at least one docket entry was made on the specified date or within the specified date range.|**(DocketEntry:(docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00])) AND (CaseStats:(allCaseDocumentCount:[0 TO 10]))** - Find cases with docket action date between 2020-01-01 and 2020-05-01 having up to 10 documents associated with it.| |**HearingDate**| Find cases with at least one hearing scheduled for the specified date or within the specified date range.|**(Hearing:(hearingDate:[now TO now+10d]))** - Find cases where hearing is scheduled in next 10 days.| |**HearingDate**| Search for cases where hearing is going to happen in 10 to 20days.|**(Hearing:(hearingDate:[now+10d TO now+20d]))** - Find cases where hearing is scheduled in next 10 to 20 days.| |**JurisdictionGeo**|Find cases in which the law of the specified state governs.|**(JurisdictionGeo:(state:\"New York\"))**- Find cases where Jurisdiction is New York state.| |**Party Address Exists**|Find cases with Party addresses.|**(Party:(Contact:(Address:(stateName:\\*))))**- Returns only those cases that have addresses for parties.| |**Document**|Find cases with specific document name and preview is available for the document.|**(CaseDocument:(name:\"civil case cover sheet\" AND isPreviewAvailable:true))**- Returns cases with document civil case cover sheet and preview is available.|

--- ## Party Sub Filter Examples |Example |Explanation | |---|---| |**(Party:(name:google AND (PartyRole:(name:\"plaintiff\"))))**|Find cases involving at least one plaintiff whose name contains the term \"Google\".| |**(Party:(name:\"OTELIA PEREIDA\" AND (AttorneyRepresentationType:(name:\"Attorney represented\")))) AND (Attorney:(name:\"Law Offices of Todd M Friedman\"))**|Find cases where the Party is *OTELIA PEREIDA* and is represented by the attorney *Law Offices of Todd M Friedman*.| --- ### All query parameters supported for this API can be found in below schema section. Schema --> CaseSearchQueryObject + + :param q: Query parameter for keyword expressions. (required) + :type q: str + :param sort: Query parameter specifying how results are to be sorted. Results can be sorted according to filedDate or relevancy. + :type sort: str + :param order: Query parameter specifying whether search result are sorted in ascending or descending order. + :type order: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_cases_serialize( + q=q, + sort=sort, + order=order, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseSearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + return response_data.response + + + def _search_cases_serialize( + self, + q, + sort, + order, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseSearch', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['q'] = \ - q - return self.search_cases_endpoint.call_with_http_info(**kwargs) + + + + @validate_call def search_cases_by_id( self, - case_search_id, - **kwargs - ): - """Case search results for a given caseSearchId. # noqa: E501 - - Retrieve the search results corresponding to the specified caseSearchId value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.search_cases_by_id(case_search_id, async_req=True) - >>> result = thread.get() - - Args: - case_search_id (str): Case Search information for the given caseSearchId. - - Keyword Args: - page_number (int): The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseSearchResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Case Search information for the given caseSearchId.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseSearchResponse: + """Case search results for a given caseSearchId. + + Retrieve the search results corresponding to the specified caseSearchId value. + + :param case_search_id: Case Search information for the given caseSearchId. (required) + :type case_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_cases_by_id_serialize( + case_search_id=case_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseSearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def search_cases_by_id_with_http_info( + self, + case_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Case Search information for the given caseSearchId.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseSearchResponse]: + """Case search results for a given caseSearchId. + + Retrieve the search results corresponding to the specified caseSearchId value. + + :param case_search_id: Case Search information for the given caseSearchId. (required) + :type case_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_cases_by_id_serialize( + case_search_id=case_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseSearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def search_cases_by_id_without_preload_content( + self, + case_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Case Search information for the given caseSearchId.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case search results for a given caseSearchId. + + Retrieve the search results corresponding to the specified caseSearchId value. + + :param case_search_id: Case Search information for the given caseSearchId. (required) + :type case_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_cases_by_id_serialize( + case_search_id=case_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseSearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + return response_data.response + + + def _search_cases_by_id_serialize( + self, + case_search_id, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_search_id is not None: + _path_params['caseSearchId'] = case_search_id + # process the query parameters + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseSearch/{caseSearchId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_search_id'] = \ - case_search_id - return self.search_cases_by_id_endpoint.call_with_http_info(**kwargs) + diff --git a/unicourt/api/case_tracking_api.py b/unicourt/api/case_tracking_api.py index d7cf232..ce79d55 100644 --- a/unicourt/api/case_tracking_api.py +++ b/unicourt/api/case_tracking_api.py @@ -1,604 +1,1156 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from datetime import datetime +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated from unicourt.model.case_track import CaseTrack from unicourt.model.case_track_list_response import CaseTrackListResponse from unicourt.model.case_track_request import CaseTrackRequest -from unicourt.model.exception import Exception from unicourt.model.success import Success +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType -class CaseTrackingApi(object): + +class CaseTrackingApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_case_track_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (CaseTrack,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseTrack/{caseId}', - 'operation_id': 'get_case_track_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - ], - 'required': [ - 'case_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_id', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_id': - (str,), - }, - 'attribute_map': { - 'case_id': 'caseId', - }, - 'location_map': { - 'case_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_tracks_endpoint = _Endpoint( - settings={ - 'response_type': (CaseTrackListResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseTracks', - 'operation_id': 'get_case_tracks', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'last_fetch_date', - 'last_fetch_date_with_updates', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'last_fetch_date', - 'last_fetch_date_with_updates', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date_with_updates',): { - 'max_length': 25, - 'min_length': 25, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'last_fetch_date': - (datetime,), - 'last_fetch_date_with_updates': - (datetime,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'last_fetch_date': 'lastFetchDate', - 'last_fetch_date_with_updates': 'lastFetchDateWithUpdates', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'last_fetch_date': 'query', - 'last_fetch_date_with_updates': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.remove_case_track_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (Success,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseTrack/{caseId}', - 'operation_id': 'remove_case_track_by_id', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - ], - 'required': [ - 'case_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_id', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_id': - (str,), - }, - 'attribute_map': { - 'case_id': 'caseId', - }, - 'location_map': { - 'case_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.track_case_endpoint = _Endpoint( - settings={ - 'response_type': (Success,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseTrack', - 'operation_id': 'track_case', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_track_request', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_track_request': - (CaseTrackRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'case_track_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def get_case_track_by_id( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value for which case tracking information is to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseTrack: + """Get Case Track for a requested Case Id. + + Retrieve case tracking information for the specified caseId value. + + :param case_id: The caseId value for which case tracking information is to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_track_by_id_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTrack", + '404': "Exception", + '451': "CaseTrack", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_track_by_id_with_http_info( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value for which case tracking information is to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseTrack]: + """Get Case Track for a requested Case Id. + + Retrieve case tracking information for the specified caseId value. + + :param case_id: The caseId value for which case tracking information is to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_track_by_id_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTrack", + '404': "Exception", + '451': "CaseTrack", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_track_by_id_without_preload_content( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value for which case tracking information is to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Case Track for a requested Case Id. + + Retrieve case tracking information for the specified caseId value. + + :param case_id: The caseId value for which case tracking information is to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_track_by_id_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTrack", + '404': "Exception", + '451': "CaseTrack", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_track_by_id_serialize( self, case_id, - **kwargs - ): - """Get Case Track for a requested Case Id. # noqa: E501 - - Retrieve case tracking information for the specified caseId value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_track_by_id(case_id, async_req=True) - >>> result = thread.get() - - Args: - case_id (str): The caseId value for which case tracking information is to be retrieved. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseTrack - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_id'] = \ - case_id - return self.get_case_track_by_id_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_id is not None: + _path_params['caseId'] = case_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + return self.api_client.param_serialize( + method='GET', + resource_path='/caseTrack/{caseId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_tracks( self, - **kwargs - ): - """Get Case Track list. # noqa: E501 - - Retrieve a list of all tracked cases. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_tracks(async_req=True) - >>> result = thread.get() - - - Keyword Args: - last_fetch_date (datetime): The lastFetchDate value of the tracked case. The date value should be entered in the format YYYY-MM-DDTHH:MM:SS+ZZ:zz. . [optional] - last_fetch_date_with_updates (datetime): The date on which changes were last found in the case information. . [optional] - page_number (int): The page number of the results to be retrieved.
- Minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseTrackListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_tracks_endpoint.call_with_http_info(**kwargs) + last_fetch_date: Annotated[Optional[datetime], Field(description="The lastFetchDate value of the tracked case. The date value should be entered in the format YYYY-MM-DDTHH:MM:SS+ZZ:zz. ")] = None, + last_fetch_date_with_updates: Annotated[Optional[datetime], Field(description="The date on which changes were last found in the case information. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the results to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseTrackListResponse: + """Get Case Track list. + + Retrieve a list of all tracked cases. + + :param last_fetch_date: The lastFetchDate value of the tracked case. The date value should be entered in the format YYYY-MM-DDTHH:MM:SS+ZZ:zz. + :type last_fetch_date: datetime + :param last_fetch_date_with_updates: The date on which changes were last found in the case information. + :type last_fetch_date_with_updates: datetime + :param page_number: The page number of the results to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_tracks_serialize( + last_fetch_date=last_fetch_date, + last_fetch_date_with_updates=last_fetch_date_with_updates, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTrackListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_tracks_with_http_info( + self, + last_fetch_date: Annotated[Optional[datetime], Field(description="The lastFetchDate value of the tracked case. The date value should be entered in the format YYYY-MM-DDTHH:MM:SS+ZZ:zz. ")] = None, + last_fetch_date_with_updates: Annotated[Optional[datetime], Field(description="The date on which changes were last found in the case information. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the results to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseTrackListResponse]: + """Get Case Track list. + + Retrieve a list of all tracked cases. + + :param last_fetch_date: The lastFetchDate value of the tracked case. The date value should be entered in the format YYYY-MM-DDTHH:MM:SS+ZZ:zz. + :type last_fetch_date: datetime + :param last_fetch_date_with_updates: The date on which changes were last found in the case information. + :type last_fetch_date_with_updates: datetime + :param page_number: The page number of the results to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_tracks_serialize( + last_fetch_date=last_fetch_date, + last_fetch_date_with_updates=last_fetch_date_with_updates, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTrackListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_tracks_without_preload_content( + self, + last_fetch_date: Annotated[Optional[datetime], Field(description="The lastFetchDate value of the tracked case. The date value should be entered in the format YYYY-MM-DDTHH:MM:SS+ZZ:zz. ")] = None, + last_fetch_date_with_updates: Annotated[Optional[datetime], Field(description="The date on which changes were last found in the case information. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the results to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Case Track list. + + Retrieve a list of all tracked cases. + + :param last_fetch_date: The lastFetchDate value of the tracked case. The date value should be entered in the format YYYY-MM-DDTHH:MM:SS+ZZ:zz. + :type last_fetch_date: datetime + :param last_fetch_date_with_updates: The date on which changes were last found in the case information. + :type last_fetch_date_with_updates: datetime + :param page_number: The page number of the results to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_tracks_serialize( + last_fetch_date=last_fetch_date, + last_fetch_date_with_updates=last_fetch_date_with_updates, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTrackListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_tracks_serialize( + self, + last_fetch_date, + last_fetch_date_with_updates, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if last_fetch_date is not None: + if isinstance(last_fetch_date, datetime): + _query_params.append( + ( + 'lastFetchDate', + last_fetch_date + ) + ) + else: + _query_params.append(('lastFetchDate', last_fetch_date)) + + if last_fetch_date_with_updates is not None: + if isinstance(last_fetch_date_with_updates, datetime): + _query_params.append( + ( + 'lastFetchDateWithUpdates', + last_fetch_date_with_updates + ) + ) + else: + _query_params.append(('lastFetchDateWithUpdates', last_fetch_date_with_updates)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseTracks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def remove_case_track_by_id( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value for which case tracking information is to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Success: + """Remove Case Track for a specific Case Id. + + Remove Case Track for a specific Case Id. + + :param case_id: The caseId value for which case tracking information is to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_case_track_by_id_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def remove_case_track_by_id_with_http_info( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value for which case tracking information is to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Success]: + """Remove Case Track for a specific Case Id. + + Remove Case Track for a specific Case Id. + + :param case_id: The caseId value for which case tracking information is to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_case_track_by_id_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def remove_case_track_by_id_without_preload_content( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value for which case tracking information is to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove Case Track for a specific Case Id. + + Remove Case Track for a specific Case Id. + + :param case_id: The caseId value for which case tracking information is to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_case_track_by_id_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_case_track_by_id_serialize( self, case_id, - **kwargs - ): - """Remove Case Track for a specific Case Id. # noqa: E501 - - Remove Case Track for a specific Case Id. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.remove_case_track_by_id(case_id, async_req=True) - >>> result = thread.get() - - Args: - case_id (str): The caseId value for which case tracking information is to be retrieved. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Success - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_id'] = \ - case_id - return self.remove_case_track_by_id_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_id is not None: + _path_params['caseId'] = case_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/caseTrack/{caseId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def track_case( self, - **kwargs - ): - """Add Case Track for the requested Case Id. # noqa: E501 - - Track the specified case. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.track_case(async_req=True) - >>> result = thread.get() - - - Keyword Args: - case_track_request (CaseTrackRequest): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Success - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.track_case_endpoint.call_with_http_info(**kwargs) + case_track_request: Optional[CaseTrackRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Success: + """Add Case Track for the requested Case Id. + + Track the specified case. The progress of this Case Track request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_track_request: + :type case_track_request: CaseTrackRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._track_case_serialize( + case_track_request=case_track_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '400': "Exception", + '403': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def track_case_with_http_info( + self, + case_track_request: Optional[CaseTrackRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Success]: + """Add Case Track for the requested Case Id. + + Track the specified case. The progress of this Case Track request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_track_request: + :type case_track_request: CaseTrackRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._track_case_serialize( + case_track_request=case_track_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '400': "Exception", + '403': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def track_case_without_preload_content( + self, + case_track_request: Optional[CaseTrackRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add Case Track for the requested Case Id. + + Track the specified case. The progress of this Case Track request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_track_request: + :type case_track_request: CaseTrackRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._track_case_serialize( + case_track_request=case_track_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '400': "Exception", + '403': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _track_case_serialize( + self, + case_track_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if case_track_request is not None: + _body_params = case_track_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/caseTrack', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + diff --git a/unicourt/api/case_update_api.py b/unicourt/api/case_update_api.py index cfbf3d7..5b8bb44 100644 --- a/unicourt/api/case_update_api.py +++ b/unicourt/api/case_update_api.py @@ -1,483 +1,901 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from datetime import datetime +from pydantic import Field, field_validator +from typing import Optional +from typing_extensions import Annotated from unicourt.model.case_update import CaseUpdate from unicourt.model.case_update_list_response import CaseUpdateListResponse from unicourt.model.case_update_request import CaseUpdateRequest -from unicourt.model.exception import Exception + +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType -class CaseUpdateApi(object): +class CaseUpdateApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_case_update_by_case_id_endpoint = _Endpoint( - settings={ - 'response_type': (CaseUpdate,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseUpdate/{caseId}', - 'operation_id': 'get_case_update_by_case_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - ], - 'required': [ - 'case_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_id', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_id': - (str,), - }, - 'attribute_map': { - 'case_id': 'caseId', - }, - 'location_map': { - 'case_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_updates_endpoint = _Endpoint( - settings={ - 'response_type': (CaseUpdateListResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseUpdates', - 'operation_id': 'get_case_updates', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_id', - 'requested_date', - 'status', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'status', - ], - 'validation': [ - 'case_id', - 'requested_date', - 'status', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('requested_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('status',): { - 'max_length': 11, - 'min_length': 7, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - ('status',): { - - "IN_PROGRESS": "IN_PROGRESS", - "COMPLETE": "COMPLETE", - "FAILURE": "FAILURE", - "DELAYED": "DELAYED" - }, - }, - 'openapi_types': { - 'case_id': - (str,), - 'requested_date': - (datetime,), - 'status': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'case_id': 'caseId', - 'requested_date': 'requestedDate', - 'status': 'status', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'case_id': 'query', - 'requested_date': 'query', - 'status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + + @validate_call + def get_case_update_by_case_id( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value of the case object for which updates are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseUpdate: + """Get Case Updates for a requested CaseId. + + Retrieve case updates for the specified case object. + + :param case_id: The caseId value of the case object for which updates are to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_update_by_case_id_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.update_case_endpoint = _Endpoint( - settings={ - 'response_type': (CaseUpdate,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/caseUpdate', - 'operation_id': 'update_case', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_update_request', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_update_request': - (CaseUpdateRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'case_update_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseUpdate", + '404': "Exception", + '451': "CaseUpdate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data - def get_case_update_by_case_id( + + @validate_call + def get_case_update_by_case_id_with_http_info( self, - case_id, - **kwargs - ): - """Get Case Updates for a requested CaseId. # noqa: E501 - - Retrieve case updates for the specified case object. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_update_by_case_id(case_id, async_req=True) - >>> result = thread.get() - - Args: - case_id (str): The caseId value of the case object for which updates are to be retrieved. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseUpdate - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value of the case object for which updates are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseUpdate]: + """Get Case Updates for a requested CaseId. + + Retrieve case updates for the specified case object. + + :param case_id: The caseId value of the case object for which updates are to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_update_by_case_id_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseUpdate", + '404': "Exception", + '451': "CaseUpdate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + + @validate_call + def get_case_update_by_case_id_without_preload_content( + self, + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value of the case object for which updates are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Case Updates for a requested CaseId. + + Retrieve case updates for the specified case object. + + :param case_id: The caseId value of the case object for which updates are to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_update_by_case_id_serialize( + case_id=case_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseUpdate", + '404': "Exception", + '451': "CaseUpdate", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + return response_data.response + + + def _get_case_update_by_case_id_serialize( + self, + case_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_id is not None: + _path_params['caseId'] = case_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseUpdate/{caseId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_id'] = \ - case_id - return self.get_case_update_by_case_id_endpoint.call_with_http_info(**kwargs) + + + + @validate_call def get_case_updates( self, - **kwargs - ): - """Get Case Update list for a requested Date. # noqa: E501 - - Retrieve case updates for the specified date. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_updates(async_req=True) - >>> result = thread.get() - - - Keyword Args: - case_id (str): The caseId value of the case for which updates should be retrieved.. [optional] - requested_date (datetime): The date for which case updates are to be retrieved.. [optional] - status (str): Status of the case updates to be retrieved.. [optional] - page_number (int): The page number of the callbacks to be retrieved.
- Minimum: 1 . [optional] if omitted the server will use the default value of 1 - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseUpdateListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="The caseId value of the case for which updates should be retrieved.")] = None, + requested_date: Annotated[Optional[datetime], Field(description="The date for which case updates are to be retrieved.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of the case updates to be retrieved.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the callbacks to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseUpdateListResponse: + """Get Case Update list for a requested Date. + + Retrieve case updates for the specified date. + + :param case_id: The caseId value of the case for which updates should be retrieved. + :type case_id: str + :param requested_date: The date for which case updates are to be retrieved. + :type requested_date: datetime + :param status: Status of the case updates to be retrieved. + :type status: str + :param page_number: The page number of the callbacks to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_updates_serialize( + case_id=case_id, + requested_date=requested_date, + status=status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseUpdateListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_updates_with_http_info( + self, + case_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="The caseId value of the case for which updates should be retrieved.")] = None, + requested_date: Annotated[Optional[datetime], Field(description="The date for which case updates are to be retrieved.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of the case updates to be retrieved.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the callbacks to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseUpdateListResponse]: + """Get Case Update list for a requested Date. + + Retrieve case updates for the specified date. + + :param case_id: The caseId value of the case for which updates should be retrieved. + :type case_id: str + :param requested_date: The date for which case updates are to be retrieved. + :type requested_date: datetime + :param status: Status of the case updates to be retrieved. + :type status: str + :param page_number: The page number of the callbacks to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_updates_serialize( + case_id=case_id, + requested_date=requested_date, + status=status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseUpdateListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + + @validate_call + def get_case_updates_without_preload_content( + self, + case_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="The caseId value of the case for which updates should be retrieved.")] = None, + requested_date: Annotated[Optional[datetime], Field(description="The date for which case updates are to be retrieved.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of the case updates to be retrieved.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the callbacks to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Case Update list for a requested Date. + + Retrieve case updates for the specified date. + + :param case_id: The caseId value of the case for which updates should be retrieved. + :type case_id: str + :param requested_date: The date for which case updates are to be retrieved. + :type requested_date: datetime + :param status: Status of the case updates to be retrieved. + :type status: str + :param page_number: The page number of the callbacks to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_updates_serialize( + case_id=case_id, + requested_date=requested_date, + status=status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseUpdateListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + return response_data.response + + + def _get_case_updates_serialize( + self, + case_id, + requested_date, + status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if case_id is not None: + + _query_params.append(('caseId', case_id)) + + if requested_date is not None: + if isinstance(requested_date, datetime): + _query_params.append( + ( + 'requestedDate', + requested_date + ) + ) + else: + _query_params.append(('requestedDate', requested_date)) + + if status is not None: + + _query_params.append(('status', status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/caseUpdates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_updates_endpoint.call_with_http_info(**kwargs) + + + + @validate_call def update_case( self, - **kwargs - ): - """Add Case Update for the requested Case Id. # noqa: E501 - - Request case updates for the specified case. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_case(async_req=True) - >>> result = thread.get() - - - Keyword Args: - case_update_request (CaseUpdateRequest): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseUpdate - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_update_request: Optional[CaseUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseUpdate: + """Add Case Update for the requested Case Id. + + Request case updates for the specified case. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. The progress of this Case Update request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_update_request: + :type case_update_request: CaseUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_case_serialize( + case_update_request=case_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseUpdate", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_case_with_http_info( + self, + case_update_request: Optional[CaseUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseUpdate]: + """Add Case Update for the requested Case Id. + + Request case updates for the specified case. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. The progress of this Case Update request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_update_request: + :type case_update_request: CaseUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_case_serialize( + case_update_request=case_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseUpdate", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + + @validate_call + def update_case_without_preload_content( + self, + case_update_request: Optional[CaseUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add Case Update for the requested Case Id. + + Request case updates for the specified case. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. The progress of this Case Update request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_update_request: + :type case_update_request: CaseUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_case_serialize( + case_update_request=case_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseUpdate", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + return response_data.response + + + def _update_case_serialize( + self, + case_update_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if case_update_request is not None: + _body_params = case_update_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/caseUpdate', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.update_case_endpoint.call_with_http_info(**kwargs) + diff --git a/unicourt/api/court_availability_api.py b/unicourt/api/court_availability_api.py index 6f95e5c..529c8ee 100644 --- a/unicourt/api/court_availability_api.py +++ b/unicourt/api/court_availability_api.py @@ -1,178 +1,299 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from pydantic import Field +from typing_extensions import Annotated from unicourt.model.court_coverage import CourtCoverage -from unicourt.model.exception import Exception +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType -class CourtAvailabilityApi(object): + +class CourtAvailabilityApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_court_coverage_endpoint = _Endpoint( - settings={ - 'response_type': (CourtCoverage,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/courtCoverage/{courtId}', - 'operation_id': 'get_court_coverage', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'court_id', - ], - 'required': [ - 'court_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'court_id', - ] - }, - root_map={ - 'validations': { - ('court_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'court_id': - (str,), - }, - 'attribute_map': { - 'court_id': 'courtId', - }, - 'location_map': { - 'court_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def get_court_coverage( self, - court_id, - **kwargs - ): - """Gets Court Coverage of all courts of specific type. # noqa: E501 - - Determine whether the specified court is covered by UniCourt. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_court_coverage(court_id, async_req=True) - >>> result = thread.get() - - Args: - court_id (str): The courtId value of the target court. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CourtCoverage - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CourtCoverage: + """Gets Court Coverage of all courts of specific type. + + Determine whether the specified court is covered by UniCourt. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_coverage_serialize( + court_id=court_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtCoverage", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_court_coverage_with_http_info( + self, + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtCoverage]: + """Gets Court Coverage of all courts of specific type. + + Determine whether the specified court is covered by UniCourt. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_coverage_serialize( + court_id=court_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtCoverage", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def get_court_coverage_without_preload_content( + self, + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Gets Court Coverage of all courts of specific type. + + Determine whether the specified court is covered by UniCourt. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_coverage_serialize( + court_id=court_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtCoverage", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_court_coverage_serialize( + self, + court_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if court_id is not None: + _path_params['courtId'] = court_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/courtCoverage/{courtId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['court_id'] = \ - court_id - return self.get_court_coverage_endpoint.call_with_http_info(**kwargs) + diff --git a/unicourt/api/court_standards_api.py b/unicourt/api/court_standards_api.py index 683a07c..e3ff9d3 100644 --- a/unicourt/api/court_standards_api.py +++ b/unicourt/api/court_standards_api.py @@ -1,26 +1,24 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated from unicourt.model.area_of_law import AreaOfLaw from unicourt.model.area_of_law_response import AreaOfLawResponse from unicourt.model.attorney_representation_type import AttorneyRepresentationType @@ -65,7 +63,6 @@ from unicourt.model.court_system_response import CourtSystemResponse from unicourt.model.court_type import CourtType from unicourt.model.court_type_response import CourtTypeResponse -from unicourt.model.exception import Exception from unicourt.model.judge_type import JudgeType from unicourt.model.judge_type_response import JudgeTypeResponse from unicourt.model.jurisdiction_geo import JurisdictionGeo @@ -75,9123 +72,16544 @@ from unicourt.model.party_role_group_response import PartyRoleGroupResponse from unicourt.model.party_role_response import PartyRoleResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType + -class CourtStandardsApi(object): +class CourtStandardsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_appeal_courts_for_court_endpoint = _Endpoint( - settings={ - 'response_type': (CourtResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/court/{courtId}/appealCourts', - 'operation_id': 'get_appeal_courts_for_court', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'court_id', - 'page_number', - 'sort', - 'order', - ], - 'required': [ - 'court_id', - ], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'court_id', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('court_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'court_id': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'court_id': 'courtId', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'court_id': 'path', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_area_of_law_endpoint = _Endpoint( - settings={ - 'response_type': (AreaOfLaw,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/areaOfLaw/{areaOfLawId}', - 'operation_id': 'get_area_of_law', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'area_of_law_id', - ], - 'required': [ - 'area_of_law_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'area_of_law_id', - ] - }, - root_map={ - 'validations': { - ('area_of_law_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'area_of_law_id': - (str,), - }, - 'attribute_map': { - 'area_of_law_id': 'areaOfLawId', - }, - 'location_map': { - 'area_of_law_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_areas_of_law_endpoint = _Endpoint( - settings={ - 'response_type': (AreaOfLawResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/areaOfLaw', - 'operation_id': 'get_areas_of_law', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_attorney_representation_type_endpoint = _Endpoint( - settings={ - 'response_type': (AttorneyRepresentationType,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/attorneyRepresentationType/{attorneyRepresentationTypeId}', - 'operation_id': 'get_attorney_representation_type', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'attorney_representation_type_id', - ], - 'required': [ - 'attorney_representation_type_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'attorney_representation_type_id', - ] - }, - root_map={ - 'validations': { - ('attorney_representation_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'attorney_representation_type_id': - (str,), - }, - 'attribute_map': { - 'attorney_representation_type_id': 'attorneyRepresentationTypeId', - }, - 'location_map': { - 'attorney_representation_type_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_attorney_representation_types_endpoint = _Endpoint( - settings={ - 'response_type': (AttorneyRepresentationTypeResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/attorneyRepresentationType', - 'operation_id': 'get_attorney_representation_types', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_attorney_type_endpoint = _Endpoint( - settings={ - 'response_type': (AttorneyType,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/attorneyType/{attorneyTypeId}', - 'operation_id': 'get_attorney_type', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'attorney_type_id', - ], - 'required': [ - 'attorney_type_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'attorney_type_id', - ] - }, - root_map={ - 'validations': { - ('attorney_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'attorney_type_id': - (str,), - }, - 'attribute_map': { - 'attorney_type_id': 'attorneyTypeId', - }, - 'location_map': { - 'attorney_type_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_attorney_types_endpoint = _Endpoint( - settings={ - 'response_type': (AttorneyTypeResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/attorneyType', - 'operation_id': 'get_attorney_types', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_class_endpoint = _Endpoint( - settings={ - 'response_type': (CaseClass,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/caseClass/{caseClassId}', - 'operation_id': 'get_case_class', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_class_id', - ], - 'required': [ - 'case_class_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_class_id', - ] - }, - root_map={ - 'validations': { - ('case_class_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_class_id': - (str,), - }, - 'attribute_map': { - 'case_class_id': 'caseClassId', - }, - 'location_map': { - 'case_class_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_relationship_type_endpoint = _Endpoint( - settings={ - 'response_type': (CaseRelationshipType,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/caseRelationshipType/{caseRelationshipTypeId}', - 'operation_id': 'get_case_relationship_type', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_relationship_type_id', - ], - 'required': [ - 'case_relationship_type_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_relationship_type_id', - ] - }, - root_map={ - 'validations': { - ('case_relationship_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_relationship_type_id': - (str,), - }, - 'attribute_map': { - 'case_relationship_type_id': 'caseRelationshipTypeId', - }, - 'location_map': { - 'case_relationship_type_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_relationship_types_endpoint = _Endpoint( - settings={ - 'response_type': (CaseRelationshipTypeResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/caseRelationshipType', - 'operation_id': 'get_case_relationship_types', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_status_endpoint = _Endpoint( - settings={ - 'response_type': (CaseStatus,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/caseStatus/{caseStatusId}', - 'operation_id': 'get_case_status', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_status_id', - ], - 'required': [ - 'case_status_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_status_id', - ] - }, - root_map={ - 'validations': { - ('case_status_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_status_id': - (str,), - }, - 'attribute_map': { - 'case_status_id': 'caseStatusId', - }, - 'location_map': { - 'case_status_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_status_group_endpoint = _Endpoint( - settings={ - 'response_type': (CaseStatusGroup,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/caseStatusGroup/{caseStatusGroupId}', - 'operation_id': 'get_case_status_group', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_status_group_id', - ], - 'required': [ - 'case_status_group_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_status_group_id', - ] - }, - root_map={ - 'validations': { - ('case_status_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_status_group_id': - (str,), - }, - 'attribute_map': { - 'case_status_group_id': 'caseStatusGroupId', - }, - 'location_map': { - 'case_status_group_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_status_groups_endpoint = _Endpoint( - settings={ - 'response_type': (CaseStatusGroupResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/caseStatusGroup', - 'operation_id': 'get_case_status_groups', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_type_endpoint = _Endpoint( - settings={ - 'response_type': (CaseType,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/caseType/{caseTypeId}', - 'operation_id': 'get_case_type', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_type_id', - ], - 'required': [ - 'case_type_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_type_id', - ] - }, - root_map={ - 'validations': { - ('case_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_type_id': - (str,), - }, - 'attribute_map': { - 'case_type_id': 'caseTypeId', - }, - 'location_map': { - 'case_type_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_type_group_endpoint = _Endpoint( - settings={ - 'response_type': (CaseTypeGroup,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/caseTypeGroup/{caseTypeGroupId}', - 'operation_id': 'get_case_type_group', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'case_type_group_id', - ], - 'required': [ - 'case_type_group_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'case_type_group_id', - ] - }, - root_map={ - 'validations': { - ('case_type_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'case_type_group_id': - (str,), - }, - 'attribute_map': { - 'case_type_group_id': 'caseTypeGroupId', - }, - 'location_map': { - 'case_type_group_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_type_groups_endpoint = _Endpoint( - settings={ - 'response_type': (CaseTypeGroupResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/caseTypeGroup', - 'operation_id': 'get_case_type_groups', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_case_types_endpoint = _Endpoint( - settings={ - 'response_type': (CaseTypeResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/caseType', - 'operation_id': 'get_case_types', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_cases_class_endpoint = _Endpoint( - settings={ - 'response_type': (CaseClassResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/caseClass', - 'operation_id': 'get_cases_class', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_cases_status_endpoint = _Endpoint( - settings={ - 'response_type': (CaseStatusResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/caseStatus', - 'operation_id': 'get_cases_status', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_cause_of_action_endpoint = _Endpoint( - settings={ - 'response_type': (CauseOfAction,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/causeOfAction/{causeOfActionId}', - 'operation_id': 'get_cause_of_action', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'cause_of_action_id', - ], - 'required': [ - 'cause_of_action_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'cause_of_action_id', - ] - }, - root_map={ - 'validations': { - ('cause_of_action_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'cause_of_action_id': - (str,), - }, - 'attribute_map': { - 'cause_of_action_id': 'causeOfActionId', - }, - 'location_map': { - 'cause_of_action_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_cause_of_action_additional_data_endpoint = _Endpoint( - settings={ - 'response_type': (CauseOfActionAdditionalData,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/causeOfActionAdditionalData/{causeOfActionAdditionalDataId}', - 'operation_id': 'get_cause_of_action_additional_data', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'cause_of_action_additional_data_id', - ], - 'required': [ - 'cause_of_action_additional_data_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'cause_of_action_additional_data_id', - ] - }, - root_map={ - 'validations': { - ('cause_of_action_additional_data_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'cause_of_action_additional_data_id': - (str,), - }, - 'attribute_map': { - 'cause_of_action_additional_data_id': 'causeOfActionAdditionalDataId', - }, - 'location_map': { - 'cause_of_action_additional_data_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_cause_of_action_group_endpoint = _Endpoint( - settings={ - 'response_type': (CauseOfActionGroup,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/causeOfActionGroup/{causeOfActionGroupId}', - 'operation_id': 'get_cause_of_action_group', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'cause_of_action_group_id', - ], - 'required': [ - 'cause_of_action_group_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'cause_of_action_group_id', - ] - }, - root_map={ - 'validations': { - ('cause_of_action_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'cause_of_action_group_id': - (str,), - }, - 'attribute_map': { - 'cause_of_action_group_id': 'causeOfActionGroupId', - }, - 'location_map': { - 'cause_of_action_group_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_causes_of_action_endpoint = _Endpoint( - settings={ - 'response_type': (CauseOfActionResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/causeOfAction', - 'operation_id': 'get_causes_of_action', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_causes_of_action_additional_data_endpoint = _Endpoint( - settings={ - 'response_type': (CauseOfActionAdditionalDataResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/causeOfActionAdditionalData', - 'operation_id': 'get_causes_of_action_additional_data', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_causes_of_action_group_endpoint = _Endpoint( - settings={ - 'response_type': (CauseOfActionGroupResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/causeOfActionGroup', - 'operation_id': 'get_causes_of_action_group', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_charge_endpoint = _Endpoint( - settings={ - 'response_type': (Charge,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/charge/{chargeId}', - 'operation_id': 'get_charge', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'charge_id', - ], - 'required': [ - 'charge_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'charge_id', - ] - }, - root_map={ - 'validations': { - ('charge_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'charge_id': - (str,), - }, - 'attribute_map': { - 'charge_id': 'chargeId', - }, - 'location_map': { - 'charge_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_charge_additional_data_endpoint = _Endpoint( - settings={ - 'response_type': (ChargeAdditionalData,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/chargeAdditionalData/{chargeAdditionalDataId}', - 'operation_id': 'get_charge_additional_data', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'charge_additional_data_id', - ], - 'required': [ - 'charge_additional_data_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'charge_additional_data_id', - ] - }, - root_map={ - 'validations': { - ('charge_additional_data_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'charge_additional_data_id': - (str,), - }, - 'attribute_map': { - 'charge_additional_data_id': 'chargeAdditionalDataId', - }, - 'location_map': { - 'charge_additional_data_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_charge_degree_endpoint = _Endpoint( - settings={ - 'response_type': (ChargeDegree,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/chargeDegree/{chargeDegreeId}', - 'operation_id': 'get_charge_degree', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'charge_degree_id', - ], - 'required': [ - 'charge_degree_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'charge_degree_id', - ] - }, - root_map={ - 'validations': { - ('charge_degree_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'charge_degree_id': - (str,), - }, - 'attribute_map': { - 'charge_degree_id': 'chargeDegreeId', - }, - 'location_map': { - 'charge_degree_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_charge_group_endpoint = _Endpoint( - settings={ - 'response_type': (ChargeGroup,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/chargeGroup/{chargeGroupId}', - 'operation_id': 'get_charge_group', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'charge_group_id', - ], - 'required': [ - 'charge_group_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'charge_group_id', - ] - }, - root_map={ - 'validations': { - ('charge_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'charge_group_id': - (str,), - }, - 'attribute_map': { - 'charge_group_id': 'chargeGroupId', - }, - 'location_map': { - 'charge_group_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_charge_groups_endpoint = _Endpoint( - settings={ - 'response_type': (ChargeGroupResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/chargeGroup', - 'operation_id': 'get_charge_groups', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_charge_severity_endpoint = _Endpoint( - settings={ - 'response_type': (ChargeSeverity,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/chargeSeverity/{chargeSeverityId}', - 'operation_id': 'get_charge_severity', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'charge_severity_id', - ], - 'required': [ - 'charge_severity_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'charge_severity_id', - ] - }, - root_map={ - 'validations': { - ('charge_severity_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'charge_severity_id': - (str,), - }, - 'attribute_map': { - 'charge_severity_id': 'chargeSeverityId', - }, - 'location_map': { - 'charge_severity_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_charges_endpoint = _Endpoint( - settings={ - 'response_type': (ChargeResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/charge', - 'operation_id': 'get_charges', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_charges_additional_data_endpoint = _Endpoint( - settings={ - 'response_type': (ChargeAdditionalDataResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/chargeAdditionalData', - 'operation_id': 'get_charges_additional_data', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_charges_degree_endpoint = _Endpoint( - settings={ - 'response_type': (ChargeDegreeResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/chargeDegree', - 'operation_id': 'get_charges_degree', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_charges_severity_endpoint = _Endpoint( - settings={ - 'response_type': (ChargeSeverityResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/chargeSeverity', - 'operation_id': 'get_charges_severity', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_court_endpoint = _Endpoint( - settings={ - 'response_type': (Court,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/court/{courtId}', - 'operation_id': 'get_court', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'court_id', - ], - 'required': [ - 'court_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'court_id', - ] - }, - root_map={ - 'validations': { - ('court_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'court_id': - (str,), - }, - 'attribute_map': { - 'court_id': 'courtId', - }, - 'location_map': { - 'court_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_court_location_endpoint = _Endpoint( - settings={ - 'response_type': (CourtLocation,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/courtLocation/{courtLocationId}', - 'operation_id': 'get_court_location', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'court_location_id', - ], - 'required': [ - 'court_location_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'court_location_id', - ] - }, - root_map={ - 'validations': { - ('court_location_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'court_location_id': - (str,), - }, - 'attribute_map': { - 'court_location_id': 'courtLocationId', - }, - 'location_map': { - 'court_location_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_court_locations_endpoint = _Endpoint( - settings={ - 'response_type': (CourtLocationResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/courtLocation', - 'operation_id': 'get_court_locations', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_court_locations_for_court_endpoint = _Endpoint( - settings={ - 'response_type': (CourtLocationResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/court/{courtId}/courtLocations', - 'operation_id': 'get_court_locations_for_court', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'court_id', - 'page_number', - 'sort', - 'order', - ], - 'required': [ - 'court_id', - ], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'court_id', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('court_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'court_id': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'court_id': 'courtId', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'court_id': 'path', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_court_service_status_endpoint = _Endpoint( - settings={ - 'response_type': (CourtServiceStatus,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/courtServiceStatus/{courtServiceStatusId}', - 'operation_id': 'get_court_service_status', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'court_service_status_id', - ], - 'required': [ - 'court_service_status_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'court_service_status_id', - ] - }, - root_map={ - 'validations': { - ('court_service_status_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'court_service_status_id': - (str,), - }, - 'attribute_map': { - 'court_service_status_id': 'courtServiceStatusId', - }, - 'location_map': { - 'court_service_status_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_court_system_endpoint = _Endpoint( - settings={ - 'response_type': (CourtSystem,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/courtSystem/{courtSystemId}', - 'operation_id': 'get_court_system', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'court_system_id', - ], - 'required': [ - 'court_system_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'court_system_id', - ] - }, - root_map={ - 'validations': { - ('court_system_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'court_system_id': - (str,), - }, - 'attribute_map': { - 'court_system_id': 'courtSystemId', - }, - 'location_map': { - 'court_system_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_court_systems_endpoint = _Endpoint( - settings={ - 'response_type': (CourtSystemResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/courtSystem', - 'operation_id': 'get_court_systems', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_court_type_endpoint = _Endpoint( - settings={ - 'response_type': (CourtType,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/courtType/{courtTypeId}', - 'operation_id': 'get_court_type', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'court_type_id', - ], - 'required': [ - 'court_type_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'court_type_id', - ] - }, - root_map={ - 'validations': { - ('court_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'court_type_id': - (str,), - }, - 'attribute_map': { - 'court_type_id': 'courtTypeId', - }, - 'location_map': { - 'court_type_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_court_types_endpoint = _Endpoint( - settings={ - 'response_type': (CourtTypeResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/courtType', - 'operation_id': 'get_court_types', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_courts_endpoint = _Endpoint( - settings={ - 'response_type': (CourtResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/court', - 'operation_id': 'get_courts', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_courts_for_court_location_endpoint = _Endpoint( - settings={ - 'response_type': (CourtResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/courtLocation/{courtLocationId}/courts', - 'operation_id': 'get_courts_for_court_location', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'court_location_id', - 'page_number', - 'sort', - 'order', - ], - 'required': [ - 'court_location_id', - ], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'court_location_id', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('court_location_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'court_location_id': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'court_location_id': 'courtLocationId', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'court_location_id': 'path', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_courts_for_jurisdiction_geo_endpoint = _Endpoint( - settings={ - 'response_type': (CourtResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/jurisdictionGeo/{jurisdictionGeoId}/courts', - 'operation_id': 'get_courts_for_jurisdiction_geo', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'jurisdiction_geo_id', - 'page_number', - 'sort', - 'order', - ], - 'required': [ - 'jurisdiction_geo_id', - ], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'jurisdiction_geo_id', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('jurisdiction_geo_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'jurisdiction_geo_id': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'jurisdiction_geo_id': 'jurisdictionGeoId', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'jurisdiction_geo_id': 'path', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_courts_service_status_endpoint = _Endpoint( - settings={ - 'response_type': (CourtServiceStatusResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/courtServiceStatus', - 'operation_id': 'get_courts_service_status', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_judge_type_endpoint = _Endpoint( - settings={ - 'response_type': (JudgeType,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/judgeType/{judgeTypeId}', - 'operation_id': 'get_judge_type', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'judge_type_id', - ], - 'required': [ - 'judge_type_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'judge_type_id', - ] - }, - root_map={ - 'validations': { - ('judge_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'judge_type_id': - (str,), - }, - 'attribute_map': { - 'judge_type_id': 'judgeTypeId', - }, - 'location_map': { - 'judge_type_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_judge_types_endpoint = _Endpoint( - settings={ - 'response_type': (JudgeTypeResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/judgeType', - 'operation_id': 'get_judge_types', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_jurisdiction_geo_endpoint = _Endpoint( - settings={ - 'response_type': (JurisdictionGeo,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/jurisdictionGeo/{jurisdictionGeoId}', - 'operation_id': 'get_jurisdiction_geo', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'jurisdiction_geo_id', - ], - 'required': [ - 'jurisdiction_geo_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'jurisdiction_geo_id', - ] - }, - root_map={ - 'validations': { - ('jurisdiction_geo_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'jurisdiction_geo_id': - (str,), - }, - 'attribute_map': { - 'jurisdiction_geo_id': 'jurisdictionGeoId', - }, - 'location_map': { - 'jurisdiction_geo_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_jurisdiction_geo_for_court_endpoint = _Endpoint( - settings={ - 'response_type': (JurisdictionGeoResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/court/{courtId}/jurisdictionGeo', - 'operation_id': 'get_jurisdiction_geo_for_court', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'court_id', - 'page_number', - 'sort', - 'order', - ], - 'required': [ - 'court_id', - ], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'court_id', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('court_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - ('sort',): { - - "STATE": "state" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'court_id': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'court_id': 'courtId', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'court_id': 'path', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_jurisdictions_geo_endpoint = _Endpoint( - settings={ - 'response_type': (JurisdictionGeoResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/jurisdictionGeo', - 'operation_id': 'get_jurisdictions_geo', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "STATE": "state" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_party_role_endpoint = _Endpoint( - settings={ - 'response_type': (PartyRole,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/partyRole/{partyRoleId}', - 'operation_id': 'get_party_role', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'party_role_id', - ], - 'required': [ - 'party_role_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'party_role_id', - ] - }, - root_map={ - 'validations': { - ('party_role_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'party_role_id': - (str,), - }, - 'attribute_map': { - 'party_role_id': 'partyRoleId', - }, - 'location_map': { - 'party_role_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_party_role_group_endpoint = _Endpoint( - settings={ - 'response_type': (PartyRoleGroup,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/partyRoleGroup/{partyRoleGroupId}', - 'operation_id': 'get_party_role_group', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'party_role_group_id', - ], - 'required': [ - 'party_role_group_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'party_role_group_id', - ] - }, - root_map={ - 'validations': { - ('party_role_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'party_role_group_id': - (str,), - }, - 'attribute_map': { - 'party_role_group_id': 'partyRoleGroupId', - }, - 'location_map': { - 'party_role_group_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_party_role_groups_endpoint = _Endpoint( - settings={ - 'response_type': (PartyRoleGroupResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/partyRoleGroup', - 'operation_id': 'get_party_role_groups', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_party_roles_endpoint = _Endpoint( - settings={ - 'response_type': (PartyRoleResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/masterData/partyRole', - 'operation_id': 'get_party_roles', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - 'sort', - 'order', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'sort', - 'order', - ], - 'validation': [ - 'q', - 'page_number', - 'sort', - 'order', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - ('sort',): { - 'max_length': 4, - 'min_length': 4, - }, - ('order',): { - 'max_length': 4, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('sort',): { - - "NAME": "name" - }, - ('order',): { - - "ASC": "asc", - "DESC": "desc" - }, - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - 'sort': - (str,), - 'order': - (str,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - 'sort': 'sort', - 'order': 'order', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - 'sort': 'query', - 'order': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def get_appeal_courts_for_court( + self, + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CourtResponse: + """Appeal Court Objects for given courtId. + + Retrieve the appeals courts associated with the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_appeal_courts_for_court_serialize( + court_id=court_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_appeal_courts_for_court_with_http_info( + self, + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtResponse]: + """Appeal Court Objects for given courtId. + + Retrieve the appeals courts associated with the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_appeal_courts_for_court_serialize( + court_id=court_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_appeal_courts_for_court_without_preload_content( + self, + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Appeal Court Objects for given courtId. + + Retrieve the appeals courts associated with the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_appeal_courts_for_court_serialize( + court_id=court_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_appeal_courts_for_court_serialize( self, court_id, - **kwargs - ): - """Appeal Court Objects for given courtId. # noqa: E501 - - Retrieve the appeals courts associated with the specified court. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_appeal_courts_for_court(court_id, async_req=True) - >>> result = thread.get() - - Args: - court_id (str): The courtId value of the target court. - - Keyword Args: - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CourtResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['court_id'] = \ - court_id - return self.get_appeal_courts_for_court_endpoint.call_with_http_info(**kwargs) - + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if court_id is not None: + _path_params['courtId'] = court_id + # process the query parameters + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/court/{courtId}/appealCourts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_area_of_law( + self, + area_of_law_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The areaOfLawId value of the desired area of law.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AreaOfLaw: + """AreaOfLaw Object for the given AreaOfLaw Id. + + Retrieve the specified area of law. + + :param area_of_law_id: The areaOfLawId value of the desired area of law. (required) + :type area_of_law_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_area_of_law_serialize( + area_of_law_id=area_of_law_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AreaOfLaw", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_area_of_law_with_http_info( + self, + area_of_law_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The areaOfLawId value of the desired area of law.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AreaOfLaw]: + """AreaOfLaw Object for the given AreaOfLaw Id. + + Retrieve the specified area of law. + + :param area_of_law_id: The areaOfLawId value of the desired area of law. (required) + :type area_of_law_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_area_of_law_serialize( + area_of_law_id=area_of_law_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AreaOfLaw", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_area_of_law_without_preload_content( + self, + area_of_law_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The areaOfLawId value of the desired area of law.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """AreaOfLaw Object for the given AreaOfLaw Id. + + Retrieve the specified area of law. + + :param area_of_law_id: The areaOfLawId value of the desired area of law. (required) + :type area_of_law_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_area_of_law_serialize( + area_of_law_id=area_of_law_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AreaOfLaw", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_area_of_law_serialize( self, area_of_law_id, - **kwargs - ): - """AreaOfLaw Object for the given AreaOfLaw Id. # noqa: E501 - - Retrieve the specified area of law. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_area_of_law(area_of_law_id, async_req=True) - >>> result = thread.get() - - Args: - area_of_law_id (str): The areaOfLawId value of the desired area of law. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AreaOfLaw - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['area_of_law_id'] = \ - area_of_law_id - return self.get_area_of_law_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if area_of_law_id is not None: + _path_params['areaOfLawId'] = area_of_law_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/areaOfLaw/{areaOfLawId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_areas_of_law( self, - **kwargs - ): - """AreaOfLaw Object. # noqa: E501 - - The keyword expression targeting the desired area of law. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> AreaOfLawQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_areas_of_law(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): Retrieve one or more areas of law using a keyword expression. Keyword expressions should be constructed according to the rules given above. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AreaOfLawResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_areas_of_law_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more areas of law using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AreaOfLawResponse: + """AreaOfLaw Object. + + The keyword expression targeting the desired area of law. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> AreaOfLawQueryObject + + :param q: Retrieve one or more areas of law using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_areas_of_law_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AreaOfLawResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_areas_of_law_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more areas of law using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AreaOfLawResponse]: + """AreaOfLaw Object. + + The keyword expression targeting the desired area of law. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> AreaOfLawQueryObject + + :param q: Retrieve one or more areas of law using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_areas_of_law_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AreaOfLawResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_areas_of_law_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more areas of law using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """AreaOfLaw Object. + + The keyword expression targeting the desired area of law. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> AreaOfLawQueryObject + + :param q: Retrieve one or more areas of law using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_areas_of_law_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AreaOfLawResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_areas_of_law_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/areaOfLaw', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_attorney_representation_type( + self, + attorney_representation_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The attorneyRepresentationTypeId value of the desired attorney representation type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AttorneyRepresentationType: + """Attorney Representation Type Object for the given attorneyRepresentationTypeId. + + Retrieve the specified attorney representation type. + + :param attorney_representation_type_id: The attorneyRepresentationTypeId value of the desired attorney representation type. (required) + :type attorney_representation_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_representation_type_serialize( + attorney_representation_type_id=attorney_representation_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AttorneyRepresentationType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_attorney_representation_type_with_http_info( + self, + attorney_representation_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The attorneyRepresentationTypeId value of the desired attorney representation type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AttorneyRepresentationType]: + """Attorney Representation Type Object for the given attorneyRepresentationTypeId. + + Retrieve the specified attorney representation type. + + :param attorney_representation_type_id: The attorneyRepresentationTypeId value of the desired attorney representation type. (required) + :type attorney_representation_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_representation_type_serialize( + attorney_representation_type_id=attorney_representation_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AttorneyRepresentationType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_attorney_representation_type_without_preload_content( + self, + attorney_representation_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The attorneyRepresentationTypeId value of the desired attorney representation type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Attorney Representation Type Object for the given attorneyRepresentationTypeId. + + Retrieve the specified attorney representation type. + + :param attorney_representation_type_id: The attorneyRepresentationTypeId value of the desired attorney representation type. (required) + :type attorney_representation_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_representation_type_serialize( + attorney_representation_type_id=attorney_representation_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AttorneyRepresentationType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_attorney_representation_type_serialize( self, attorney_representation_type_id, - **kwargs - ): - """Attorney Representation Type Object for the given attorneyRepresentationTypeId. # noqa: E501 - - Retrieve the specified attorney representation type. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_attorney_representation_type(attorney_representation_type_id, async_req=True) - >>> result = thread.get() - - Args: - attorney_representation_type_id (str): The attorneyRepresentationTypeId value of the desired attorney representation type. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AttorneyRepresentationType - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['attorney_representation_type_id'] = \ - attorney_representation_type_id - return self.get_attorney_representation_type_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if attorney_representation_type_id is not None: + _path_params['attorneyRepresentationTypeId'] = attorney_representation_type_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/attorneyRepresentationType/{attorneyRepresentationTypeId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_attorney_representation_types( self, - **kwargs - ): - """Attorney Representation Type Object. # noqa: E501 - - Retrieve an attorney representation type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyRepresentationTypeQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_attorney_representation_types(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the attorney representation type. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AttorneyRepresentationTypeResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_attorney_representation_types_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the attorney representation type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AttorneyRepresentationTypeResponse: + """Attorney Representation Type Object. + + Retrieve an attorney representation type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyRepresentationTypeQueryObject + + :param q: The keyword expression targeting the attorney representation type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_representation_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AttorneyRepresentationTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_attorney_representation_types_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the attorney representation type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AttorneyRepresentationTypeResponse]: + """Attorney Representation Type Object. + + Retrieve an attorney representation type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyRepresentationTypeQueryObject + + :param q: The keyword expression targeting the attorney representation type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_representation_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AttorneyRepresentationTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_attorney_representation_types_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the attorney representation type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Attorney Representation Type Object. + + Retrieve an attorney representation type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyRepresentationTypeQueryObject + + :param q: The keyword expression targeting the attorney representation type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_representation_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AttorneyRepresentationTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_attorney_representation_types_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/attorneyRepresentationType', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_attorney_type( + self, + attorney_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The attorneyTypeId value of the desired attorney type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AttorneyType: + """Attorney Type Object for given Attorney Type Id. + + Retrieve a specified attorney type object. + + :param attorney_type_id: The attorneyTypeId value of the desired attorney type. (required) + :type attorney_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_type_serialize( + attorney_type_id=attorney_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AttorneyType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_attorney_type_with_http_info( + self, + attorney_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The attorneyTypeId value of the desired attorney type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AttorneyType]: + """Attorney Type Object for given Attorney Type Id. + + Retrieve a specified attorney type object. + + :param attorney_type_id: The attorneyTypeId value of the desired attorney type. (required) + :type attorney_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_type_serialize( + attorney_type_id=attorney_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AttorneyType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_attorney_type_without_preload_content( + self, + attorney_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The attorneyTypeId value of the desired attorney type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Attorney Type Object for given Attorney Type Id. + + Retrieve a specified attorney type object. + + :param attorney_type_id: The attorneyTypeId value of the desired attorney type. (required) + :type attorney_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_type_serialize( + attorney_type_id=attorney_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AttorneyType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_attorney_type_serialize( self, attorney_type_id, - **kwargs - ): - """Attorney Type Object for given Attorney Type Id. # noqa: E501 - - Retrieve a specified attorney type object. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_attorney_type(attorney_type_id, async_req=True) - >>> result = thread.get() - - Args: - attorney_type_id (str): The attorneyTypeId value of the desired attorney type. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AttorneyType - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['attorney_type_id'] = \ - attorney_type_id - return self.get_attorney_type_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if attorney_type_id is not None: + _path_params['attorneyTypeId'] = attorney_type_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/attorneyType/{attorneyTypeId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_attorney_types( self, - **kwargs - ): - """Attorney Type Object. # noqa: E501 - - Retrieve an attorney type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyTypeQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_attorney_types(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the attorney type. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AttorneyTypeResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_attorney_types_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the attorney type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AttorneyTypeResponse: + """Attorney Type Object. + + Retrieve an attorney type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyTypeQueryObject + + :param q: The keyword expression targeting the attorney type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AttorneyTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_attorney_types_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the attorney type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AttorneyTypeResponse]: + """Attorney Type Object. + + Retrieve an attorney type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyTypeQueryObject + + :param q: The keyword expression targeting the attorney type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AttorneyTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_attorney_types_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the attorney type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Attorney Type Object. + + Retrieve an attorney type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyTypeQueryObject + + :param q: The keyword expression targeting the attorney type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_attorney_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AttorneyTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_attorney_types_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/attorneyType', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_class( + self, + case_class_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseClassId value of the desired case class.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseClass: + """Case Class Object for the given Case Class Id. + + Retrieve the specified case class. + + :param case_class_id: The caseClassId value of the desired case class. (required) + :type case_class_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_class_serialize( + case_class_id=case_class_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseClass", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_class_with_http_info( + self, + case_class_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseClassId value of the desired case class.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseClass]: + """Case Class Object for the given Case Class Id. + + Retrieve the specified case class. + + :param case_class_id: The caseClassId value of the desired case class. (required) + :type case_class_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_class_serialize( + case_class_id=case_class_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseClass", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_class_without_preload_content( + self, + case_class_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseClassId value of the desired case class.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Class Object for the given Case Class Id. + + Retrieve the specified case class. + + :param case_class_id: The caseClassId value of the desired case class. (required) + :type case_class_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_class_serialize( + case_class_id=case_class_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseClass", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_class_serialize( self, case_class_id, - **kwargs - ): - """Case Class Object for the given Case Class Id. # noqa: E501 - - Retrieve the specified case class. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_class(case_class_id, async_req=True) - >>> result = thread.get() - - Args: - case_class_id (str): The caseClassId value of the desired case class. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseClass - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_class_id'] = \ - case_class_id - return self.get_case_class_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_class_id is not None: + _path_params['caseClassId'] = case_class_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/caseClass/{caseClassId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_relationship_type( + self, + case_relationship_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseRelationshipTypeId value of the desired case relationship type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseRelationshipType: + """Case Relationship Type Object for the given caseRelationshipTypeId. + + Retrieve the specified case relationship type. + + :param case_relationship_type_id: The caseRelationshipTypeId value of the desired case relationship type. (required) + :type case_relationship_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_relationship_type_serialize( + case_relationship_type_id=case_relationship_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseRelationshipType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_relationship_type_with_http_info( + self, + case_relationship_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseRelationshipTypeId value of the desired case relationship type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseRelationshipType]: + """Case Relationship Type Object for the given caseRelationshipTypeId. + + Retrieve the specified case relationship type. + + :param case_relationship_type_id: The caseRelationshipTypeId value of the desired case relationship type. (required) + :type case_relationship_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_relationship_type_serialize( + case_relationship_type_id=case_relationship_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseRelationshipType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_relationship_type_without_preload_content( + self, + case_relationship_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseRelationshipTypeId value of the desired case relationship type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Relationship Type Object for the given caseRelationshipTypeId. + + Retrieve the specified case relationship type. + + :param case_relationship_type_id: The caseRelationshipTypeId value of the desired case relationship type. (required) + :type case_relationship_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_relationship_type_serialize( + case_relationship_type_id=case_relationship_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseRelationshipType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_relationship_type_serialize( self, case_relationship_type_id, - **kwargs - ): - """Case Relationship Type Object for the given caseRelationshipTypeId. # noqa: E501 - - Retrieve the specified case relationship type. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_relationship_type(case_relationship_type_id, async_req=True) - >>> result = thread.get() - - Args: - case_relationship_type_id (str): The caseRelationshipTypeId value of the desired case relationship type. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseRelationshipType - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_relationship_type_id'] = \ - case_relationship_type_id - return self.get_case_relationship_type_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if case_relationship_type_id is not None: + _path_params['caseRelationshipTypeId'] = case_relationship_type_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/caseRelationshipType/{caseRelationshipTypeId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_relationship_types( self, - **kwargs - ): - """Case Relationship Type Object. # noqa: E501 - - Retrieve an case relationship type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseRelationshipTypeQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_relationship_types(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the case relationship type. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseRelationshipTypeResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_relationship_types_endpoint.call_with_http_info(**kwargs) - + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the case relationship type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseRelationshipTypeResponse: + """Case Relationship Type Object. + + Retrieve an case relationship type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseRelationshipTypeQueryObject + + :param q: The keyword expression targeting the case relationship type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_relationship_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseRelationshipTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_relationship_types_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the case relationship type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseRelationshipTypeResponse]: + """Case Relationship Type Object. + + Retrieve an case relationship type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseRelationshipTypeQueryObject + + :param q: The keyword expression targeting the case relationship type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_relationship_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseRelationshipTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_relationship_types_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the case relationship type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Relationship Type Object. + + Retrieve an case relationship type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseRelationshipTypeQueryObject + + :param q: The keyword expression targeting the case relationship type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_relationship_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseRelationshipTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_relationship_types_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/caseRelationshipType', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_case_status( + self, + case_status_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseStatusId value of the desired case status.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseStatus: + """Returns the caseStatus information for the given caseStatusId. + + Retrieve the specified case status. + + :param case_status_id: The caseStatusId value of the desired case status. (required) + :type case_status_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_status_serialize( + case_status_id=case_status_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseStatus", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_status_with_http_info( + self, + case_status_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseStatusId value of the desired case status.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseStatus]: + """Returns the caseStatus information for the given caseStatusId. + + Retrieve the specified case status. + + :param case_status_id: The caseStatusId value of the desired case status. (required) + :type case_status_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_status_serialize( + case_status_id=case_status_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseStatus", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_status_without_preload_content( + self, + case_status_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseStatusId value of the desired case status.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Returns the caseStatus information for the given caseStatusId. + + Retrieve the specified case status. + + :param case_status_id: The caseStatusId value of the desired case status. (required) + :type case_status_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_status_serialize( + case_status_id=case_status_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseStatus", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_status_serialize( self, case_status_id, - **kwargs - ): - """Returns the caseStatus information for the given caseStatusId. # noqa: E501 - - Retrieve the specified case status. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_status(case_status_id, async_req=True) - >>> result = thread.get() - - Args: - case_status_id (str): The caseStatusId value of the desired case status. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseStatus - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_status_id'] = \ - case_status_id - return self.get_case_status_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if case_status_id is not None: + _path_params['caseStatusId'] = case_status_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/caseStatus/{caseStatusId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_case_status_group( + self, + case_status_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseStatusGroupId value of the desired case status group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseStatusGroup: + """Returns the caseStatusGroup information for the given caseStatusGroupId. + + Retrieve the specified case status group. + + :param case_status_group_id: The caseStatusGroupId value of the desired case status group. (required) + :type case_status_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_status_group_serialize( + case_status_group_id=case_status_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseStatusGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_status_group_with_http_info( + self, + case_status_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseStatusGroupId value of the desired case status group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseStatusGroup]: + """Returns the caseStatusGroup information for the given caseStatusGroupId. + + Retrieve the specified case status group. + + :param case_status_group_id: The caseStatusGroupId value of the desired case status group. (required) + :type case_status_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_status_group_serialize( + case_status_group_id=case_status_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseStatusGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_status_group_without_preload_content( + self, + case_status_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseStatusGroupId value of the desired case status group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Returns the caseStatusGroup information for the given caseStatusGroupId. + + Retrieve the specified case status group. + + :param case_status_group_id: The caseStatusGroupId value of the desired case status group. (required) + :type case_status_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_status_group_serialize( + case_status_group_id=case_status_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseStatusGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_status_group_serialize( self, case_status_group_id, - **kwargs - ): - """Returns the caseStatusGroup information for the given caseStatusGroupId. # noqa: E501 - - Retrieve the specified case status group. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_status_group(case_status_group_id, async_req=True) - >>> result = thread.get() - - Args: - case_status_group_id (str): The caseStatusGroupId value of the desired case status group. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseStatusGroup - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_status_group_id'] = \ - case_status_group_id - return self.get_case_status_group_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - def get_case_status_groups( - self, - **kwargs - ): - """Case Status Group Object. # noqa: E501 - - Retrieve a case status group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseStatusGroupQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_status_groups(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired case status group. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseStatusGroupResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_status_groups_endpoint.call_with_http_info(**kwargs) + _host = None - def get_case_type( - self, - case_type_id, - **kwargs - ): - """CaseType Object for given Case Type Id. # noqa: E501 - - Retrieve the specified case type. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_type(case_type_id, async_req=True) - >>> result = thread.get() - - Args: - case_type_id (str): The caseTypeId value of the desired case type. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseType - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_type_id'] = \ - case_type_id - return self.get_case_type_endpoint.call_with_http_info(**kwargs) + _collection_formats: Dict[str, str] = { + } - def get_case_type_group( - self, - case_type_group_id, - **kwargs - ): - """CaseType Group for the given CaseType Group Id. # noqa: E501 - - Retrieve the specified case type group. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_type_group(case_type_group_id, async_req=True) - >>> result = thread.get() - - Args: - case_type_group_id (str): caseTypeGroupId - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseTypeGroup - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['case_type_group_id'] = \ - case_type_group_id - return self.get_case_type_group_endpoint.call_with_http_info(**kwargs) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None - def get_case_type_groups( - self, - **kwargs - ): - """CaseTypeGroup Object. # noqa: E501 - - Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeGroupQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_type_groups(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseTypeGroupResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_type_groups_endpoint.call_with_http_info(**kwargs) + # process the path parameters + if case_status_group_id is not None: + _path_params['caseStatusGroupId'] = case_status_group_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter - def get_case_types( - self, - **kwargs - ): - """Case Type Object. # noqa: E501 - - Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_case_types(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseTypeResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_case_types_endpoint.call_with_http_info(**kwargs) - def get_cases_class( - self, - **kwargs - ): - """Case Class Object. # noqa: E501 - - Retrieve one or more case classes using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseClassQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_cases_class(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired case class. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseClassResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_cases_class_endpoint.call_with_http_info(**kwargs) + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - def get_cases_status( - self, - **kwargs - ): - """Case Status Object. # noqa: E501 - - Retrieve a case status using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> CaseStatusQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_cases_status(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired case status. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CaseStatusResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_cases_status_endpoint.call_with_http_info(**kwargs) - def get_cause_of_action( - self, - cause_of_action_id, - **kwargs - ): - """CauseOfAction Object for the given causeOfActionId. # noqa: E501 - - Retrieve the specified cause of action. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_cause_of_action(cause_of_action_id, async_req=True) - >>> result = thread.get() - - Args: - cause_of_action_id (str): The causeOfActionId value of the desired cause of action. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CauseOfAction - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['cause_of_action_id'] = \ - cause_of_action_id - return self.get_cause_of_action_endpoint.call_with_http_info(**kwargs) + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] - def get_cause_of_action_additional_data( - self, - cause_of_action_additional_data_id, - **kwargs - ): - """CauseOfActionAdditionalData Object for the given causeOfActionAdditionalDataId. # noqa: E501 - - Retrieve the specified cause of action additional data. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_cause_of_action_additional_data(cause_of_action_additional_data_id, async_req=True) - >>> result = thread.get() - - Args: - cause_of_action_additional_data_id (str): The causeOfActionAdditionalDataId value of the desired cause of action additional data. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CauseOfActionAdditionalData - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['cause_of_action_additional_data_id'] = \ - cause_of_action_additional_data_id - return self.get_cause_of_action_additional_data_endpoint.call_with_http_info(**kwargs) + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/caseStatusGroup/{caseStatusGroupId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - def get_cause_of_action_group( - self, - cause_of_action_group_id, - **kwargs - ): - """CauseOfActionGroup Object for the given causeOfActionGroupId. # noqa: E501 - - Retrieve the specified cause of action group. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_cause_of_action_group(cause_of_action_group_id, async_req=True) - >>> result = thread.get() - - Args: - cause_of_action_group_id (str): causeOfActionGroupId - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CauseOfActionGroup - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['cause_of_action_group_id'] = \ - cause_of_action_group_id - return self.get_cause_of_action_group_endpoint.call_with_http_info(**kwargs) - def get_causes_of_action( - self, - **kwargs - ): - """CauseOfAction Object. # noqa: E501 - - Retrieve a cause of action using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_causes_of_action(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired cause of action. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CauseOfActionResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_causes_of_action_endpoint.call_with_http_info(**kwargs) - def get_causes_of_action_additional_data( - self, - **kwargs - ): - """CauseOfActionAdditionaData Object. # noqa: E501 - - Retrieve a cause of action additional data using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionAdditionalDataQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_causes_of_action_additional_data(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired cause of action additional data. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CauseOfActionAdditionalDataResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_causes_of_action_additional_data_endpoint.call_with_http_info(**kwargs) - def get_causes_of_action_group( + @validate_call + def get_case_status_groups( self, - **kwargs - ): - """CauseOfActionGroup Object. # noqa: E501 - - Retrieve a cause of action group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionGroupQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_causes_of_action_group(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired cause of action group. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CauseOfActionGroupResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_causes_of_action_group_endpoint.call_with_http_info(**kwargs) - - def get_charge( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case status group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseStatusGroupResponse: + """Case Status Group Object. + + Retrieve a case status group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseStatusGroupQueryObject + + :param q: The keyword expression targeting the desired case status group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_status_groups_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseStatusGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_status_groups_with_http_info( self, - charge_id, - **kwargs - ): - """Charge Object for the given chargeId. # noqa: E501 - - Retrieve the specified charge. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_charge(charge_id, async_req=True) - >>> result = thread.get() - - Args: - charge_id (str): The chargeId value of the desired charge. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Charge - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['charge_id'] = \ - charge_id - return self.get_charge_endpoint.call_with_http_info(**kwargs) - - def get_charge_additional_data( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case status group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseStatusGroupResponse]: + """Case Status Group Object. + + Retrieve a case status group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseStatusGroupQueryObject + + :param q: The keyword expression targeting the desired case status group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_status_groups_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseStatusGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_status_groups_without_preload_content( self, - charge_additional_data_id, - **kwargs - ): - """Charge Additional Data Object for the given chargeAdditionalDataId. # noqa: E501 - - Retrieve the specified charge additional data. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_charge_additional_data(charge_additional_data_id, async_req=True) - >>> result = thread.get() - - Args: - charge_additional_data_id (str): The chargeAdditionalDataId value of the desired charge additional data. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ChargeAdditionalData - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['charge_additional_data_id'] = \ - charge_additional_data_id - return self.get_charge_additional_data_endpoint.call_with_http_info(**kwargs) - - def get_charge_degree( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case status group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Status Group Object. + + Retrieve a case status group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseStatusGroupQueryObject + + :param q: The keyword expression targeting the desired case status group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_status_groups_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseStatusGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_status_groups_serialize( self, - charge_degree_id, - **kwargs - ): - """ChargeDegree Object for the given chargeDegreeId. # noqa: E501 - - Retrieve the specified charge degree. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_charge_degree(charge_degree_id, async_req=True) - >>> result = thread.get() - - Args: - charge_degree_id (str): The chargeDegreeId value of the desired charge degree. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ChargeDegree - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['charge_degree_id'] = \ - charge_degree_id - return self.get_charge_degree_endpoint.call_with_http_info(**kwargs) - - def get_charge_group( + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/caseStatusGroup', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_case_type( self, - charge_group_id, - **kwargs - ): - """Charge Group Object for the given chargeGroupId. # noqa: E501 - - Retrieve the specified charge group. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_charge_group(charge_group_id, async_req=True) - >>> result = thread.get() - - Args: - charge_group_id (str): The chargeGroupId value of the desired charge group. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ChargeGroup - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['charge_group_id'] = \ - charge_group_id - return self.get_charge_group_endpoint.call_with_http_info(**kwargs) - - def get_charge_groups( + case_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseTypeId value of the desired case type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseType: + """CaseType Object for given Case Type Id. + + Retrieve the specified case type. + + :param case_type_id: The caseTypeId value of the desired case type. (required) + :type case_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_type_serialize( + case_type_id=case_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_type_with_http_info( self, - **kwargs - ): - """Charge Group Object. # noqa: E501 - - Retrieve one or more charge groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeGroupQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_charge_groups(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired charge group. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ChargeGroupResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_charge_groups_endpoint.call_with_http_info(**kwargs) - - def get_charge_severity( + case_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseTypeId value of the desired case type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseType]: + """CaseType Object for given Case Type Id. + + Retrieve the specified case type. + + :param case_type_id: The caseTypeId value of the desired case type. (required) + :type case_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_type_serialize( + case_type_id=case_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_type_without_preload_content( self, - charge_severity_id, - **kwargs - ): - """ChargeSeverity Object for the given chargeSeverityId. # noqa: E501 - - Retrieve the specified charge severity. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_charge_severity(charge_severity_id, async_req=True) - >>> result = thread.get() - - Args: - charge_severity_id (str): The chargeSeverityId value of the desired charge severity. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ChargeSeverity - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['charge_severity_id'] = \ - charge_severity_id - return self.get_charge_severity_endpoint.call_with_http_info(**kwargs) - - def get_charges( + case_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseTypeId value of the desired case type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """CaseType Object for given Case Type Id. + + Retrieve the specified case type. + + :param case_type_id: The caseTypeId value of the desired case type. (required) + :type case_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_type_serialize( + case_type_id=case_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_type_serialize( self, - **kwargs - ): - """Charge Object. # noqa: E501 - - Retrieve one or more charges using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_charges(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired charge. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ChargeResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_charges_endpoint.call_with_http_info(**kwargs) + case_type_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - def get_charges_additional_data( - self, - **kwargs - ): - """Charge Additional Data Object. # noqa: E501 - - Retrieve additional information on a charge using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeAdditionalDataQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_charges_additional_data(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired charge additional data. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ChargeAdditionalDataResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_charges_additional_data_endpoint.call_with_http_info(**kwargs) + _host = None - def get_charges_degree( - self, - **kwargs - ): - """ChargeDegree Object. # noqa: E501 - - Retrieve a charge degree using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeDegreeQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_charges_degree(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired charge degree. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ChargeDegreeResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_charges_degree_endpoint.call_with_http_info(**kwargs) + _collection_formats: Dict[str, str] = { + } - def get_charges_severity( - self, - **kwargs - ): - """ChargeSeverity Object. # noqa: E501 - - Retrieve a charge severity using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeSeverityQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_charges_severity(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired charge severity. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ChargeSeverityResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_charges_severity_endpoint.call_with_http_info(**kwargs) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None - def get_court( - self, - court_id, - **kwargs - ): - """Court Object for given courtId. # noqa: E501 - - Retrieve information about a specified court. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_court(court_id, async_req=True) - >>> result = thread.get() - - Args: - court_id (str): The courtId value of the target court. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Court - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['court_id'] = \ - court_id - return self.get_court_endpoint.call_with_http_info(**kwargs) + # process the path parameters + if case_type_id is not None: + _path_params['caseTypeId'] = case_type_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter - def get_court_location( - self, - court_location_id, - **kwargs - ): - """Courthouse Object for given Court Location Id. # noqa: E501 - - Contains the Court Location Object. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_court_location(court_location_id, async_req=True) - >>> result = thread.get() - - Args: - court_location_id (str): courtLocationId - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CourtLocation - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['court_location_id'] = \ - court_location_id - return self.get_court_location_endpoint.call_with_http_info(**kwargs) - def get_court_locations( - self, - **kwargs - ): - """Courthouse Object. # noqa: E501 - - Retrieve the specified court location or court locations. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtLocationQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_court_locations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression that sets forth the criteria concerning the court location or court locations to target. Keyword expressions should be constructed according to the rules shown above. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CourtLocationResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_court_locations_endpoint.call_with_http_info(**kwargs) + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - def get_court_locations_for_court( - self, - court_id, - **kwargs - ): - """Associated Court Location for given courtId. # noqa: E501 - - Retrieve the court locations associated with the specified court. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_court_locations_for_court(court_id, async_req=True) - >>> result = thread.get() - - Args: - court_id (str): The courtId value of the target court. - - Keyword Args: - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CourtLocationResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['court_id'] = \ - court_id - return self.get_court_locations_for_court_endpoint.call_with_http_info(**kwargs) - def get_court_service_status( - self, - court_service_status_id, - **kwargs - ): - """Court Service Status Object for the given courtServiceStatusId. # noqa: E501 - - Retrieve the court status of the specified court. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_court_service_status(court_service_status_id, async_req=True) - >>> result = thread.get() - - Args: - court_service_status_id (str): The courtServiceStatusId value of the desired court. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CourtServiceStatus - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['court_service_status_id'] = \ - court_service_status_id - return self.get_court_service_status_endpoint.call_with_http_info(**kwargs) + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] - def get_court_system( - self, - court_system_id, - **kwargs - ): - """Court System Object for given courtSystemId. # noqa: E501 - - Retrieve the specified court system. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_court_system(court_system_id, async_req=True) - >>> result = thread.get() - - Args: - court_system_id (str): The courtSystemId value of the court system to be retrieved. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CourtSystem - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['court_system_id'] = \ - court_system_id - return self.get_court_system_endpoint.call_with_http_info(**kwargs) + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/caseType/{caseTypeId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - def get_court_systems( - self, - **kwargs - ): - """Court System Objects. # noqa: E501 - - Retrieve information about the specified court system or court systems. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtSystemQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_court_systems(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression that sets forth the criteria concerning the court system or court systems. Keyword expressions should be constructed according to the rules shown above. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CourtSystemResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_court_systems_endpoint.call_with_http_info(**kwargs) - def get_court_type( - self, - court_type_id, - **kwargs - ): - """Court Type Object for given courtTypeId. # noqa: E501 - - Retrieve the information concerning the specific court type. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_court_type(court_type_id, async_req=True) - >>> result = thread.get() - - Args: - court_type_id (str): The courtTypeId value of the court type to be retrieved. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CourtType - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['court_type_id'] = \ - court_type_id - return self.get_court_type_endpoint.call_with_http_info(**kwargs) - def get_court_types( - self, - **kwargs - ): - """Court Type Objects. # noqa: E501 - - Retrieve court types recognized by UniCourt. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtTypeQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_court_types(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression that sets forth the criteria concerning the court type or court types. Keyword expressions should be constructed according to the rules shown above. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CourtTypeResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_court_types_endpoint.call_with_http_info(**kwargs) - def get_courts( + @validate_call + def get_case_type_group( self, - **kwargs - ): - """Court Objects. # noqa: E501 - - Retrieve information about a specified court or courts. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_courts(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression that sets forth the criteria concerning the court or courts to be retrieved. Keyword expressions should be constructed according to the rules shown above. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CourtResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_courts_endpoint.call_with_http_info(**kwargs) - - def get_courts_for_court_location( + case_type_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="caseTypeGroupId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseTypeGroup: + """CaseType Group for the given CaseType Group Id. + + Retrieve the specified case type group. + + :param case_type_group_id: caseTypeGroupId (required) + :type case_type_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_type_group_serialize( + case_type_group_id=case_type_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTypeGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_type_group_with_http_info( self, - court_location_id, - **kwargs - ): - """Associated Court for given Court Location. # noqa: E501 - - Retrieve the courts associated with the specified court location. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_courts_for_court_location(court_location_id, async_req=True) - >>> result = thread.get() - - Args: - court_location_id (str): The courtLocationId value of the court location for which courts are to be retrieved. - - Keyword Args: - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CourtResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['court_location_id'] = \ - court_location_id - return self.get_courts_for_court_location_endpoint.call_with_http_info(**kwargs) - - def get_courts_for_jurisdiction_geo( + case_type_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="caseTypeGroupId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseTypeGroup]: + """CaseType Group for the given CaseType Group Id. + + Retrieve the specified case type group. + + :param case_type_group_id: caseTypeGroupId (required) + :type case_type_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_type_group_serialize( + case_type_group_id=case_type_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTypeGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_type_group_without_preload_content( self, - jurisdiction_geo_id, - **kwargs - ): - """Associated Court for given Jurisdiction Geo. # noqa: E501 - - Returns Associated Court for given Jurisdiction Geo. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_courts_for_jurisdiction_geo(jurisdiction_geo_id, async_req=True) - >>> result = thread.get() - - Args: - jurisdiction_geo_id (str): jurisdictionGeoId - - Keyword Args: - page_number (int): Page number. - minimum: 1 - maximum: 100 . [optional] - sort (str): Sort field.. [optional] if omitted the server will use the default value of "name" - order (str): Sort order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CourtResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['jurisdiction_geo_id'] = \ - jurisdiction_geo_id - return self.get_courts_for_jurisdiction_geo_endpoint.call_with_http_info(**kwargs) - - def get_courts_service_status( + case_type_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="caseTypeGroupId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """CaseType Group for the given CaseType Group Id. + + Retrieve the specified case type group. + + :param case_type_group_id: caseTypeGroupId (required) + :type case_type_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_type_group_serialize( + case_type_group_id=case_type_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTypeGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_type_group_serialize( self, - **kwargs - ): - """Court Service Status Object. # noqa: E501 - - Retrieve the status of one or more courts using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtServiceStatusQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_courts_service_status(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired court. Keyword expressions should be constructed according to the rules given above. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CourtServiceStatusResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_courts_service_status_endpoint.call_with_http_info(**kwargs) + case_type_group_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - def get_judge_type( - self, - judge_type_id, - **kwargs - ): - """Judge Type Object for the given judgeTypeId. # noqa: E501 - - Retrieve the specified judge type. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_judge_type(judge_type_id, async_req=True) - >>> result = thread.get() - - Args: - judge_type_id (str): The judgeTypeId of the desired judge type. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - JudgeType - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['judge_type_id'] = \ - judge_type_id - return self.get_judge_type_endpoint.call_with_http_info(**kwargs) + _host = None - def get_judge_types( - self, - **kwargs - ): - """Judge Type Object. # noqa: E501 - - Retrieve a judge type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JudgeTypeQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_judge_types(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the judge type. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - JudgeTypeResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_judge_types_endpoint.call_with_http_info(**kwargs) + _collection_formats: Dict[str, str] = { + } - def get_jurisdiction_geo( - self, - jurisdiction_geo_id, - **kwargs - ): - """Jurisdiction Geo Object for given Jurisdiction Geo Id. # noqa: E501 - - Retrieve the specified jurisdiction geography. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_jurisdiction_geo(jurisdiction_geo_id, async_req=True) - >>> result = thread.get() - - Args: - jurisdiction_geo_id (str): The jurisdictionGeoId value of the desired jurisdiction geography. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - JurisdictionGeo - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['jurisdiction_geo_id'] = \ - jurisdiction_geo_id - return self.get_jurisdiction_geo_endpoint.call_with_http_info(**kwargs) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None - def get_jurisdiction_geo_for_court( - self, - court_id, - **kwargs - ): - """Jurisdiction Geo Objects for given courtId. # noqa: E501 - - Retrieve the jurisdiction geography object for the specified court. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_jurisdiction_geo_for_court(court_id, async_req=True) - >>> result = thread.get() - - Args: - court_id (str): The courtId value of the target court. - - Keyword Args: - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "state" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - JurisdictionGeoResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['court_id'] = \ - court_id - return self.get_jurisdiction_geo_for_court_endpoint.call_with_http_info(**kwargs) + # process the path parameters + if case_type_group_id is not None: + _path_params['caseTypeGroupId'] = case_type_group_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter - def get_jurisdictions_geo( - self, - **kwargs - ): - """Jurisdiction Geo Object. # noqa: E501 - - Retrieve one or more jurisdiction geographies using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JurisdictionGeoQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_jurisdictions_geo(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired jurisdiction geography. Keyword expressions should be constructed according to the rules given above. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "state" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - JurisdictionGeoResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_jurisdictions_geo_endpoint.call_with_http_info(**kwargs) - def get_party_role( - self, - party_role_id, - **kwargs - ): - """Party Role Object. # noqa: E501 - - Retrieve the specified party role. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_party_role(party_role_id, async_req=True) - >>> result = thread.get() - - Args: - party_role_id (str): The partyRoleId value of the desired party role. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PartyRole - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['party_role_id'] = \ - party_role_id - return self.get_party_role_endpoint.call_with_http_info(**kwargs) + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - def get_party_role_group( - self, - party_role_group_id, - **kwargs - ): - """Party Role Group Object. # noqa: E501 - - Retrieve the specified party role group. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_party_role_group(party_role_group_id, async_req=True) - >>> result = thread.get() - - Args: - party_role_group_id (str): The partyRoleGroupId value of the desired party role group. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PartyRoleGroup - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['party_role_group_id'] = \ - party_role_group_id - return self.get_party_role_group_endpoint.call_with_http_info(**kwargs) - def get_party_role_groups( - self, - **kwargs - ): - """Party Role Group Object. # noqa: E501 - - Retrieve a party role group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleGroupQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_party_role_groups(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired party role group. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PartyRoleGroupResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_party_role_groups_endpoint.call_with_http_info(**kwargs) + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/caseTypeGroup/{caseTypeGroupId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_case_type_groups( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseTypeGroupResponse: + """CaseTypeGroup Object. + + Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeGroupQueryObject + + :param q: Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_type_groups_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTypeGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_type_groups_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseTypeGroupResponse]: + """CaseTypeGroup Object. + + Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeGroupQueryObject + + :param q: Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_type_groups_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTypeGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_type_groups_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """CaseTypeGroup Object. + + Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeGroupQueryObject + + :param q: Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_type_groups_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTypeGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_type_groups_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/caseTypeGroup', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_case_types( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseTypeResponse: + """Case Type Object. + + Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeQueryObject + + :param q: Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_case_types_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseTypeResponse]: + """Case Type Object. + + Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeQueryObject + + :param q: Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_case_types_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Type Object. + + Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeQueryObject + + :param q: Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_case_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_case_types_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/caseType', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_cases_class( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case class. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseClassResponse: + """Case Class Object. + + Retrieve one or more case classes using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseClassQueryObject + + :param q: The keyword expression targeting the desired case class. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cases_class_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseClassResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_cases_class_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case class. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseClassResponse]: + """Case Class Object. + + Retrieve one or more case classes using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseClassQueryObject + + :param q: The keyword expression targeting the desired case class. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cases_class_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseClassResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_cases_class_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case class. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Class Object. + + Retrieve one or more case classes using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseClassQueryObject + + :param q: The keyword expression targeting the desired case class. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cases_class_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseClassResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_cases_class_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/caseClass', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_cases_status( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case status. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CaseStatusResponse: + """Case Status Object. + + Retrieve a case status using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> CaseStatusQueryObject + + :param q: The keyword expression targeting the desired case status. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cases_status_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseStatusResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_cases_status_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case status. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseStatusResponse]: + """Case Status Object. + + Retrieve a case status using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> CaseStatusQueryObject + + :param q: The keyword expression targeting the desired case status. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cases_status_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseStatusResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_cases_status_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case status. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Case Status Object. + + Retrieve a case status using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> CaseStatusQueryObject + + :param q: The keyword expression targeting the desired case status. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cases_status_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CaseStatusResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_cases_status_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/caseStatus', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_cause_of_action( + self, + cause_of_action_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The causeOfActionId value of the desired cause of action.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CauseOfAction: + """CauseOfAction Object for the given causeOfActionId. + + Retrieve the specified cause of action. + + :param cause_of_action_id: The causeOfActionId value of the desired cause of action. (required) + :type cause_of_action_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cause_of_action_serialize( + cause_of_action_id=cause_of_action_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfAction", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_cause_of_action_with_http_info( + self, + cause_of_action_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The causeOfActionId value of the desired cause of action.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CauseOfAction]: + """CauseOfAction Object for the given causeOfActionId. + + Retrieve the specified cause of action. + + :param cause_of_action_id: The causeOfActionId value of the desired cause of action. (required) + :type cause_of_action_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cause_of_action_serialize( + cause_of_action_id=cause_of_action_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfAction", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_cause_of_action_without_preload_content( + self, + cause_of_action_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The causeOfActionId value of the desired cause of action.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """CauseOfAction Object for the given causeOfActionId. + + Retrieve the specified cause of action. + + :param cause_of_action_id: The causeOfActionId value of the desired cause of action. (required) + :type cause_of_action_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cause_of_action_serialize( + cause_of_action_id=cause_of_action_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfAction", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_cause_of_action_serialize( + self, + cause_of_action_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if cause_of_action_id is not None: + _path_params['causeOfActionId'] = cause_of_action_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/causeOfAction/{causeOfActionId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_cause_of_action_additional_data( + self, + cause_of_action_additional_data_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The causeOfActionAdditionalDataId value of the desired cause of action additional data.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CauseOfActionAdditionalData: + """CauseOfActionAdditionalData Object for the given causeOfActionAdditionalDataId. + + Retrieve the specified cause of action additional data. + + :param cause_of_action_additional_data_id: The causeOfActionAdditionalDataId value of the desired cause of action additional data. (required) + :type cause_of_action_additional_data_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cause_of_action_additional_data_serialize( + cause_of_action_additional_data_id=cause_of_action_additional_data_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionAdditionalData", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_cause_of_action_additional_data_with_http_info( + self, + cause_of_action_additional_data_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The causeOfActionAdditionalDataId value of the desired cause of action additional data.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CauseOfActionAdditionalData]: + """CauseOfActionAdditionalData Object for the given causeOfActionAdditionalDataId. + + Retrieve the specified cause of action additional data. + + :param cause_of_action_additional_data_id: The causeOfActionAdditionalDataId value of the desired cause of action additional data. (required) + :type cause_of_action_additional_data_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cause_of_action_additional_data_serialize( + cause_of_action_additional_data_id=cause_of_action_additional_data_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionAdditionalData", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_cause_of_action_additional_data_without_preload_content( + self, + cause_of_action_additional_data_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The causeOfActionAdditionalDataId value of the desired cause of action additional data.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """CauseOfActionAdditionalData Object for the given causeOfActionAdditionalDataId. + + Retrieve the specified cause of action additional data. + + :param cause_of_action_additional_data_id: The causeOfActionAdditionalDataId value of the desired cause of action additional data. (required) + :type cause_of_action_additional_data_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cause_of_action_additional_data_serialize( + cause_of_action_additional_data_id=cause_of_action_additional_data_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionAdditionalData", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_cause_of_action_additional_data_serialize( + self, + cause_of_action_additional_data_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if cause_of_action_additional_data_id is not None: + _path_params['causeOfActionAdditionalDataId'] = cause_of_action_additional_data_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/causeOfActionAdditionalData/{causeOfActionAdditionalDataId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_cause_of_action_group( + self, + cause_of_action_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="causeOfActionGroupId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CauseOfActionGroup: + """CauseOfActionGroup Object for the given causeOfActionGroupId. + + Retrieve the specified cause of action group. + + :param cause_of_action_group_id: causeOfActionGroupId (required) + :type cause_of_action_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cause_of_action_group_serialize( + cause_of_action_group_id=cause_of_action_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_cause_of_action_group_with_http_info( + self, + cause_of_action_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="causeOfActionGroupId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CauseOfActionGroup]: + """CauseOfActionGroup Object for the given causeOfActionGroupId. + + Retrieve the specified cause of action group. + + :param cause_of_action_group_id: causeOfActionGroupId (required) + :type cause_of_action_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cause_of_action_group_serialize( + cause_of_action_group_id=cause_of_action_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_cause_of_action_group_without_preload_content( + self, + cause_of_action_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="causeOfActionGroupId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """CauseOfActionGroup Object for the given causeOfActionGroupId. + + Retrieve the specified cause of action group. + + :param cause_of_action_group_id: causeOfActionGroupId (required) + :type cause_of_action_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_cause_of_action_group_serialize( + cause_of_action_group_id=cause_of_action_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_cause_of_action_group_serialize( + self, + cause_of_action_group_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if cause_of_action_group_id is not None: + _path_params['causeOfActionGroupId'] = cause_of_action_group_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/causeOfActionGroup/{causeOfActionGroupId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_causes_of_action( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CauseOfActionResponse: + """CauseOfAction Object. + + Retrieve a cause of action using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionQueryObject + + :param q: The keyword expression targeting the desired cause of action. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_causes_of_action_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_causes_of_action_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CauseOfActionResponse]: + """CauseOfAction Object. + + Retrieve a cause of action using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionQueryObject + + :param q: The keyword expression targeting the desired cause of action. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_causes_of_action_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_causes_of_action_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """CauseOfAction Object. + + Retrieve a cause of action using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionQueryObject + + :param q: The keyword expression targeting the desired cause of action. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_causes_of_action_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_causes_of_action_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/causeOfAction', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_causes_of_action_additional_data( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action additional data. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CauseOfActionAdditionalDataResponse: + """CauseOfActionAdditionaData Object. + + Retrieve a cause of action additional data using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionAdditionalDataQueryObject + + :param q: The keyword expression targeting the desired cause of action additional data. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_causes_of_action_additional_data_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionAdditionalDataResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_causes_of_action_additional_data_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action additional data. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CauseOfActionAdditionalDataResponse]: + """CauseOfActionAdditionaData Object. + + Retrieve a cause of action additional data using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionAdditionalDataQueryObject + + :param q: The keyword expression targeting the desired cause of action additional data. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_causes_of_action_additional_data_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionAdditionalDataResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_causes_of_action_additional_data_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action additional data. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """CauseOfActionAdditionaData Object. + + Retrieve a cause of action additional data using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionAdditionalDataQueryObject + + :param q: The keyword expression targeting the desired cause of action additional data. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_causes_of_action_additional_data_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionAdditionalDataResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_causes_of_action_additional_data_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/causeOfActionAdditionalData', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_causes_of_action_group( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CauseOfActionGroupResponse: + """CauseOfActionGroup Object. + + Retrieve a cause of action group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionGroupQueryObject + + :param q: The keyword expression targeting the desired cause of action group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_causes_of_action_group_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_causes_of_action_group_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CauseOfActionGroupResponse]: + """CauseOfActionGroup Object. + + Retrieve a cause of action group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionGroupQueryObject + + :param q: The keyword expression targeting the desired cause of action group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_causes_of_action_group_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_causes_of_action_group_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """CauseOfActionGroup Object. + + Retrieve a cause of action group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionGroupQueryObject + + :param q: The keyword expression targeting the desired cause of action group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_causes_of_action_group_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CauseOfActionGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_causes_of_action_group_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/causeOfActionGroup', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_charge( + self, + charge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeId value of the desired charge.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Charge: + """Charge Object for the given chargeId. + + Retrieve the specified charge. + + :param charge_id: The chargeId value of the desired charge. (required) + :type charge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_serialize( + charge_id=charge_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Charge", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_charge_with_http_info( + self, + charge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeId value of the desired charge.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Charge]: + """Charge Object for the given chargeId. + + Retrieve the specified charge. + + :param charge_id: The chargeId value of the desired charge. (required) + :type charge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_serialize( + charge_id=charge_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Charge", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_charge_without_preload_content( + self, + charge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeId value of the desired charge.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Charge Object for the given chargeId. + + Retrieve the specified charge. + + :param charge_id: The chargeId value of the desired charge. (required) + :type charge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_serialize( + charge_id=charge_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Charge", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_charge_serialize( + self, + charge_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if charge_id is not None: + _path_params['chargeId'] = charge_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/charge/{chargeId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_charge_additional_data( + self, + charge_additional_data_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeAdditionalDataId value of the desired charge additional data.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ChargeAdditionalData: + """Charge Additional Data Object for the given chargeAdditionalDataId. + + Retrieve the specified charge additional data. + + :param charge_additional_data_id: The chargeAdditionalDataId value of the desired charge additional data. (required) + :type charge_additional_data_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_additional_data_serialize( + charge_additional_data_id=charge_additional_data_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeAdditionalData", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_charge_additional_data_with_http_info( + self, + charge_additional_data_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeAdditionalDataId value of the desired charge additional data.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeAdditionalData]: + """Charge Additional Data Object for the given chargeAdditionalDataId. + + Retrieve the specified charge additional data. + + :param charge_additional_data_id: The chargeAdditionalDataId value of the desired charge additional data. (required) + :type charge_additional_data_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_additional_data_serialize( + charge_additional_data_id=charge_additional_data_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeAdditionalData", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_charge_additional_data_without_preload_content( + self, + charge_additional_data_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeAdditionalDataId value of the desired charge additional data.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Charge Additional Data Object for the given chargeAdditionalDataId. + + Retrieve the specified charge additional data. + + :param charge_additional_data_id: The chargeAdditionalDataId value of the desired charge additional data. (required) + :type charge_additional_data_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_additional_data_serialize( + charge_additional_data_id=charge_additional_data_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeAdditionalData", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_charge_additional_data_serialize( + self, + charge_additional_data_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if charge_additional_data_id is not None: + _path_params['chargeAdditionalDataId'] = charge_additional_data_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/chargeAdditionalData/{chargeAdditionalDataId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_charge_degree( + self, + charge_degree_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeDegreeId value of the desired charge degree.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ChargeDegree: + """ChargeDegree Object for the given chargeDegreeId. + + Retrieve the specified charge degree. + + :param charge_degree_id: The chargeDegreeId value of the desired charge degree. (required) + :type charge_degree_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_degree_serialize( + charge_degree_id=charge_degree_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeDegree", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_charge_degree_with_http_info( + self, + charge_degree_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeDegreeId value of the desired charge degree.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeDegree]: + """ChargeDegree Object for the given chargeDegreeId. + + Retrieve the specified charge degree. + + :param charge_degree_id: The chargeDegreeId value of the desired charge degree. (required) + :type charge_degree_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_degree_serialize( + charge_degree_id=charge_degree_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeDegree", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_charge_degree_without_preload_content( + self, + charge_degree_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeDegreeId value of the desired charge degree.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """ChargeDegree Object for the given chargeDegreeId. + + Retrieve the specified charge degree. + + :param charge_degree_id: The chargeDegreeId value of the desired charge degree. (required) + :type charge_degree_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_degree_serialize( + charge_degree_id=charge_degree_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeDegree", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_charge_degree_serialize( + self, + charge_degree_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if charge_degree_id is not None: + _path_params['chargeDegreeId'] = charge_degree_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/chargeDegree/{chargeDegreeId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_charge_group( + self, + charge_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeGroupId value of the desired charge group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ChargeGroup: + """Charge Group Object for the given chargeGroupId. + + Retrieve the specified charge group. + + :param charge_group_id: The chargeGroupId value of the desired charge group. (required) + :type charge_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_group_serialize( + charge_group_id=charge_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_charge_group_with_http_info( + self, + charge_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeGroupId value of the desired charge group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeGroup]: + """Charge Group Object for the given chargeGroupId. + + Retrieve the specified charge group. + + :param charge_group_id: The chargeGroupId value of the desired charge group. (required) + :type charge_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_group_serialize( + charge_group_id=charge_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_charge_group_without_preload_content( + self, + charge_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeGroupId value of the desired charge group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Charge Group Object for the given chargeGroupId. + + Retrieve the specified charge group. + + :param charge_group_id: The chargeGroupId value of the desired charge group. (required) + :type charge_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_group_serialize( + charge_group_id=charge_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_charge_group_serialize( + self, + charge_group_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if charge_group_id is not None: + _path_params['chargeGroupId'] = charge_group_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/chargeGroup/{chargeGroupId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_charge_groups( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ChargeGroupResponse: + """Charge Group Object. + + Retrieve one or more charge groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeGroupQueryObject + + :param q: The keyword expression targeting the desired charge group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_groups_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_charge_groups_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeGroupResponse]: + """Charge Group Object. + + Retrieve one or more charge groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeGroupQueryObject + + :param q: The keyword expression targeting the desired charge group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_groups_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_charge_groups_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Charge Group Object. + + Retrieve one or more charge groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeGroupQueryObject + + :param q: The keyword expression targeting the desired charge group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_groups_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_charge_groups_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/chargeGroup', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_charge_severity( + self, + charge_severity_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeSeverityId value of the desired charge severity.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ChargeSeverity: + """ChargeSeverity Object for the given chargeSeverityId. + + Retrieve the specified charge severity. + + :param charge_severity_id: The chargeSeverityId value of the desired charge severity. (required) + :type charge_severity_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_severity_serialize( + charge_severity_id=charge_severity_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeSeverity", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_charge_severity_with_http_info( + self, + charge_severity_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeSeverityId value of the desired charge severity.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeSeverity]: + """ChargeSeverity Object for the given chargeSeverityId. + + Retrieve the specified charge severity. + + :param charge_severity_id: The chargeSeverityId value of the desired charge severity. (required) + :type charge_severity_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_severity_serialize( + charge_severity_id=charge_severity_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeSeverity", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_charge_severity_without_preload_content( + self, + charge_severity_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeSeverityId value of the desired charge severity.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """ChargeSeverity Object for the given chargeSeverityId. + + Retrieve the specified charge severity. + + :param charge_severity_id: The chargeSeverityId value of the desired charge severity. (required) + :type charge_severity_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charge_severity_serialize( + charge_severity_id=charge_severity_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeSeverity", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_charge_severity_serialize( + self, + charge_severity_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if charge_severity_id is not None: + _path_params['chargeSeverityId'] = charge_severity_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/chargeSeverity/{chargeSeverityId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_charges( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ChargeResponse: + """Charge Object. + + Retrieve one or more charges using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeQueryObject + + :param q: The keyword expression targeting the desired charge. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charges_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_charges_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeResponse]: + """Charge Object. + + Retrieve one or more charges using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeQueryObject + + :param q: The keyword expression targeting the desired charge. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charges_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_charges_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Charge Object. + + Retrieve one or more charges using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeQueryObject + + :param q: The keyword expression targeting the desired charge. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charges_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_charges_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/charge', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_charges_additional_data( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge additional data. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ChargeAdditionalDataResponse: + """Charge Additional Data Object. + + Retrieve additional information on a charge using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeAdditionalDataQueryObject + + :param q: The keyword expression targeting the desired charge additional data. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charges_additional_data_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeAdditionalDataResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_charges_additional_data_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge additional data. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeAdditionalDataResponse]: + """Charge Additional Data Object. + + Retrieve additional information on a charge using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeAdditionalDataQueryObject + + :param q: The keyword expression targeting the desired charge additional data. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charges_additional_data_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeAdditionalDataResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_charges_additional_data_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge additional data. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Charge Additional Data Object. + + Retrieve additional information on a charge using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeAdditionalDataQueryObject + + :param q: The keyword expression targeting the desired charge additional data. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charges_additional_data_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeAdditionalDataResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_charges_additional_data_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/chargeAdditionalData', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_charges_degree( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge degree. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ChargeDegreeResponse: + """ChargeDegree Object. + + Retrieve a charge degree using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeDegreeQueryObject + + :param q: The keyword expression targeting the desired charge degree. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charges_degree_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeDegreeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_charges_degree_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge degree. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeDegreeResponse]: + """ChargeDegree Object. + + Retrieve a charge degree using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeDegreeQueryObject + + :param q: The keyword expression targeting the desired charge degree. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charges_degree_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeDegreeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_charges_degree_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge degree. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """ChargeDegree Object. + + Retrieve a charge degree using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeDegreeQueryObject + + :param q: The keyword expression targeting the desired charge degree. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charges_degree_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeDegreeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_charges_degree_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/chargeDegree', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_charges_severity( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge severity. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ChargeSeverityResponse: + """ChargeSeverity Object. + + Retrieve a charge severity using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeSeverityQueryObject + + :param q: The keyword expression targeting the desired charge severity. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charges_severity_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeSeverityResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_charges_severity_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge severity. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeSeverityResponse]: + """ChargeSeverity Object. + + Retrieve a charge severity using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeSeverityQueryObject + + :param q: The keyword expression targeting the desired charge severity. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charges_severity_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeSeverityResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_charges_severity_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge severity. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """ChargeSeverity Object. + + Retrieve a charge severity using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeSeverityQueryObject + + :param q: The keyword expression targeting the desired charge severity. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_charges_severity_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ChargeSeverityResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_charges_severity_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/chargeSeverity', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_court( + self, + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Court: + """Court Object for given courtId. + + Retrieve information about a specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_serialize( + court_id=court_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Court", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_court_with_http_info( + self, + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Court]: + """Court Object for given courtId. + + Retrieve information about a specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_serialize( + court_id=court_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Court", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_court_without_preload_content( + self, + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Court Object for given courtId. + + Retrieve information about a specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_serialize( + court_id=court_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Court", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_court_serialize( + self, + court_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if court_id is not None: + _path_params['courtId'] = court_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/court/{courtId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_court_location( + self, + court_location_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="courtLocationId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CourtLocation: + """Courthouse Object for given Court Location Id. + + Contains the Court Location Object. + + :param court_location_id: courtLocationId (required) + :type court_location_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_location_serialize( + court_location_id=court_location_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtLocation", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_court_location_with_http_info( + self, + court_location_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="courtLocationId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtLocation]: + """Courthouse Object for given Court Location Id. + + Contains the Court Location Object. + + :param court_location_id: courtLocationId (required) + :type court_location_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_location_serialize( + court_location_id=court_location_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtLocation", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_court_location_without_preload_content( + self, + court_location_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="courtLocationId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Courthouse Object for given Court Location Id. + + Contains the Court Location Object. + + :param court_location_id: courtLocationId (required) + :type court_location_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_location_serialize( + court_location_id=court_location_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtLocation", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_court_location_serialize( + self, + court_location_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if court_location_id is not None: + _path_params['courtLocationId'] = court_location_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/courtLocation/{courtLocationId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_court_locations( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court location or court locations to target. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CourtLocationResponse: + """Courthouse Object. + + Retrieve the specified court location or court locations. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtLocationQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court location or court locations to target. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_locations_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtLocationResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_court_locations_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court location or court locations to target. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtLocationResponse]: + """Courthouse Object. + + Retrieve the specified court location or court locations. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtLocationQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court location or court locations to target. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_locations_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtLocationResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_court_locations_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court location or court locations to target. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Courthouse Object. + + Retrieve the specified court location or court locations. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtLocationQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court location or court locations to target. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_locations_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtLocationResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_court_locations_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/courtLocation', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_court_locations_for_court( + self, + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CourtLocationResponse: + """Associated Court Location for given courtId. + + Retrieve the court locations associated with the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_locations_for_court_serialize( + court_id=court_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtLocationResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_court_locations_for_court_with_http_info( + self, + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtLocationResponse]: + """Associated Court Location for given courtId. + + Retrieve the court locations associated with the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_locations_for_court_serialize( + court_id=court_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtLocationResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_court_locations_for_court_without_preload_content( + self, + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Associated Court Location for given courtId. + + Retrieve the court locations associated with the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_locations_for_court_serialize( + court_id=court_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtLocationResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_court_locations_for_court_serialize( + self, + court_id, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if court_id is not None: + _path_params['courtId'] = court_id + # process the query parameters + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/court/{courtId}/courtLocations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_court_service_status( + self, + court_service_status_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtServiceStatusId value of the desired court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CourtServiceStatus: + """Court Service Status Object for the given courtServiceStatusId. + + Retrieve the court status of the specified court. + + :param court_service_status_id: The courtServiceStatusId value of the desired court. (required) + :type court_service_status_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_service_status_serialize( + court_service_status_id=court_service_status_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtServiceStatus", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_court_service_status_with_http_info( + self, + court_service_status_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtServiceStatusId value of the desired court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtServiceStatus]: + """Court Service Status Object for the given courtServiceStatusId. + + Retrieve the court status of the specified court. + + :param court_service_status_id: The courtServiceStatusId value of the desired court. (required) + :type court_service_status_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_service_status_serialize( + court_service_status_id=court_service_status_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtServiceStatus", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_court_service_status_without_preload_content( + self, + court_service_status_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtServiceStatusId value of the desired court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Court Service Status Object for the given courtServiceStatusId. + + Retrieve the court status of the specified court. + + :param court_service_status_id: The courtServiceStatusId value of the desired court. (required) + :type court_service_status_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_service_status_serialize( + court_service_status_id=court_service_status_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtServiceStatus", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_court_service_status_serialize( + self, + court_service_status_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if court_service_status_id is not None: + _path_params['courtServiceStatusId'] = court_service_status_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/courtServiceStatus/{courtServiceStatusId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_court_system( + self, + court_system_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtSystemId value of the court system to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CourtSystem: + """Court System Object for given courtSystemId. + + Retrieve the specified court system. + + :param court_system_id: The courtSystemId value of the court system to be retrieved. (required) + :type court_system_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_system_serialize( + court_system_id=court_system_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtSystem", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_court_system_with_http_info( + self, + court_system_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtSystemId value of the court system to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtSystem]: + """Court System Object for given courtSystemId. + + Retrieve the specified court system. + + :param court_system_id: The courtSystemId value of the court system to be retrieved. (required) + :type court_system_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_system_serialize( + court_system_id=court_system_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtSystem", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_court_system_without_preload_content( + self, + court_system_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtSystemId value of the court system to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Court System Object for given courtSystemId. + + Retrieve the specified court system. + + :param court_system_id: The courtSystemId value of the court system to be retrieved. (required) + :type court_system_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_system_serialize( + court_system_id=court_system_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtSystem", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_court_system_serialize( + self, + court_system_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if court_system_id is not None: + _path_params['courtSystemId'] = court_system_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/courtSystem/{courtSystemId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_court_systems( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court system or court systems. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CourtSystemResponse: + """Court System Objects. + + Retrieve information about the specified court system or court systems. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtSystemQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court system or court systems. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_systems_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtSystemResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_court_systems_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court system or court systems. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtSystemResponse]: + """Court System Objects. + + Retrieve information about the specified court system or court systems. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtSystemQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court system or court systems. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_systems_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtSystemResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_court_systems_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court system or court systems. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Court System Objects. + + Retrieve information about the specified court system or court systems. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtSystemQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court system or court systems. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_systems_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtSystemResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_court_systems_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/courtSystem', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_court_type( + self, + court_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtTypeId value of the court type to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CourtType: + """Court Type Object for given courtTypeId. + + Retrieve the information concerning the specific court type. + + :param court_type_id: The courtTypeId value of the court type to be retrieved. (required) + :type court_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_type_serialize( + court_type_id=court_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_court_type_with_http_info( + self, + court_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtTypeId value of the court type to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtType]: + """Court Type Object for given courtTypeId. + + Retrieve the information concerning the specific court type. + + :param court_type_id: The courtTypeId value of the court type to be retrieved. (required) + :type court_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_type_serialize( + court_type_id=court_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_court_type_without_preload_content( + self, + court_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtTypeId value of the court type to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Court Type Object for given courtTypeId. + + Retrieve the information concerning the specific court type. + + :param court_type_id: The courtTypeId value of the court type to be retrieved. (required) + :type court_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_type_serialize( + court_type_id=court_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_court_type_serialize( + self, + court_type_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if court_type_id is not None: + _path_params['courtTypeId'] = court_type_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/courtType/{courtTypeId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_court_types( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court type or court types. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CourtTypeResponse: + """Court Type Objects. + + Retrieve court types recognized by UniCourt. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtTypeQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court type or court types. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_court_types_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court type or court types. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtTypeResponse]: + """Court Type Objects. + + Retrieve court types recognized by UniCourt. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtTypeQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court type or court types. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_court_types_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court type or court types. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Court Type Objects. + + Retrieve court types recognized by UniCourt. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtTypeQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court type or court types. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_court_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_court_types_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/courtType', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_courts( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court or courts to be retrieved. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CourtResponse: + """Court Objects. + + Retrieve information about a specified court or courts. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court or courts to be retrieved. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_courts_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_courts_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court or courts to be retrieved. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtResponse]: + """Court Objects. + + Retrieve information about a specified court or courts. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court or courts to be retrieved. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_courts_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_courts_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court or courts to be retrieved. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Court Objects. + + Retrieve information about a specified court or courts. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court or courts to be retrieved. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_courts_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_courts_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/court', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_courts_for_court_location( + self, + court_location_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtLocationId value of the court location for which courts are to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CourtResponse: + """Associated Court for given Court Location. + + Retrieve the courts associated with the specified court location. + + :param court_location_id: The courtLocationId value of the court location for which courts are to be retrieved. (required) + :type court_location_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_courts_for_court_location_serialize( + court_location_id=court_location_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_courts_for_court_location_with_http_info( + self, + court_location_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtLocationId value of the court location for which courts are to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtResponse]: + """Associated Court for given Court Location. + + Retrieve the courts associated with the specified court location. + + :param court_location_id: The courtLocationId value of the court location for which courts are to be retrieved. (required) + :type court_location_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_courts_for_court_location_serialize( + court_location_id=court_location_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_courts_for_court_location_without_preload_content( + self, + court_location_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtLocationId value of the court location for which courts are to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Associated Court for given Court Location. + + Retrieve the courts associated with the specified court location. + + :param court_location_id: The courtLocationId value of the court location for which courts are to be retrieved. (required) + :type court_location_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_courts_for_court_location_serialize( + court_location_id=court_location_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_courts_for_court_location_serialize( + self, + court_location_id, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if court_location_id is not None: + _path_params['courtLocationId'] = court_location_id + # process the query parameters + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/courtLocation/{courtLocationId}/courts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_courts_for_jurisdiction_geo( + self, + jurisdiction_geo_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="jurisdictionGeoId")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page number. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CourtResponse: + """Associated Court for given Jurisdiction Geo. + + Returns Associated Court for given Jurisdiction Geo. + + :param jurisdiction_geo_id: jurisdictionGeoId (required) + :type jurisdiction_geo_id: str + :param page_number: Page number. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: Sort field. + :type sort: str + :param order: Sort order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_courts_for_jurisdiction_geo_serialize( + jurisdiction_geo_id=jurisdiction_geo_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_courts_for_jurisdiction_geo_with_http_info( + self, + jurisdiction_geo_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="jurisdictionGeoId")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page number. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtResponse]: + """Associated Court for given Jurisdiction Geo. + + Returns Associated Court for given Jurisdiction Geo. + + :param jurisdiction_geo_id: jurisdictionGeoId (required) + :type jurisdiction_geo_id: str + :param page_number: Page number. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: Sort field. + :type sort: str + :param order: Sort order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_courts_for_jurisdiction_geo_serialize( + jurisdiction_geo_id=jurisdiction_geo_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_courts_for_jurisdiction_geo_without_preload_content( + self, + jurisdiction_geo_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="jurisdictionGeoId")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page number. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Associated Court for given Jurisdiction Geo. + + Returns Associated Court for given Jurisdiction Geo. + + :param jurisdiction_geo_id: jurisdictionGeoId (required) + :type jurisdiction_geo_id: str + :param page_number: Page number. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: Sort field. + :type sort: str + :param order: Sort order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_courts_for_jurisdiction_geo_serialize( + jurisdiction_geo_id=jurisdiction_geo_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_courts_for_jurisdiction_geo_serialize( + self, + jurisdiction_geo_id, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if jurisdiction_geo_id is not None: + _path_params['jurisdictionGeoId'] = jurisdiction_geo_id + # process the query parameters + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/jurisdictionGeo/{jurisdictionGeoId}/courts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_courts_service_status( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired court. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CourtServiceStatusResponse: + """Court Service Status Object. + + Retrieve the status of one or more courts using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtServiceStatusQueryObject + + :param q: The keyword expression targeting the desired court. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_courts_service_status_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtServiceStatusResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_courts_service_status_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired court. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtServiceStatusResponse]: + """Court Service Status Object. + + Retrieve the status of one or more courts using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtServiceStatusQueryObject + + :param q: The keyword expression targeting the desired court. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_courts_service_status_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtServiceStatusResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_courts_service_status_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired court. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Court Service Status Object. + + Retrieve the status of one or more courts using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtServiceStatusQueryObject + + :param q: The keyword expression targeting the desired court. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_courts_service_status_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CourtServiceStatusResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_courts_service_status_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/courtServiceStatus', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_judge_type( + self, + judge_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The judgeTypeId of the desired judge type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> JudgeType: + """Judge Type Object for the given judgeTypeId. + + Retrieve the specified judge type. + + :param judge_type_id: The judgeTypeId of the desired judge type. (required) + :type judge_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_judge_type_serialize( + judge_type_id=judge_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JudgeType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_judge_type_with_http_info( + self, + judge_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The judgeTypeId of the desired judge type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JudgeType]: + """Judge Type Object for the given judgeTypeId. + + Retrieve the specified judge type. + + :param judge_type_id: The judgeTypeId of the desired judge type. (required) + :type judge_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_judge_type_serialize( + judge_type_id=judge_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JudgeType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_judge_type_without_preload_content( + self, + judge_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The judgeTypeId of the desired judge type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Judge Type Object for the given judgeTypeId. + + Retrieve the specified judge type. + + :param judge_type_id: The judgeTypeId of the desired judge type. (required) + :type judge_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_judge_type_serialize( + judge_type_id=judge_type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JudgeType", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_judge_type_serialize( + self, + judge_type_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if judge_type_id is not None: + _path_params['judgeTypeId'] = judge_type_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/judgeType/{judgeTypeId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_judge_types( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the judge type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> JudgeTypeResponse: + """Judge Type Object. + + Retrieve a judge type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JudgeTypeQueryObject + + :param q: The keyword expression targeting the judge type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_judge_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JudgeTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_judge_types_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the judge type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JudgeTypeResponse]: + """Judge Type Object. + + Retrieve a judge type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JudgeTypeQueryObject + + :param q: The keyword expression targeting the judge type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_judge_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JudgeTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_judge_types_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the judge type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Judge Type Object. + + Retrieve a judge type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JudgeTypeQueryObject + + :param q: The keyword expression targeting the judge type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_judge_types_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JudgeTypeResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_judge_types_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/judgeType', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_jurisdiction_geo( + self, + jurisdiction_geo_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The jurisdictionGeoId value of the desired jurisdiction geography.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> JurisdictionGeo: + """Jurisdiction Geo Object for given Jurisdiction Geo Id. + + Retrieve the specified jurisdiction geography. + + :param jurisdiction_geo_id: The jurisdictionGeoId value of the desired jurisdiction geography. (required) + :type jurisdiction_geo_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_jurisdiction_geo_serialize( + jurisdiction_geo_id=jurisdiction_geo_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JurisdictionGeo", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_jurisdiction_geo_with_http_info( + self, + jurisdiction_geo_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The jurisdictionGeoId value of the desired jurisdiction geography.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JurisdictionGeo]: + """Jurisdiction Geo Object for given Jurisdiction Geo Id. + + Retrieve the specified jurisdiction geography. + + :param jurisdiction_geo_id: The jurisdictionGeoId value of the desired jurisdiction geography. (required) + :type jurisdiction_geo_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_jurisdiction_geo_serialize( + jurisdiction_geo_id=jurisdiction_geo_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JurisdictionGeo", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_jurisdiction_geo_without_preload_content( + self, + jurisdiction_geo_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The jurisdictionGeoId value of the desired jurisdiction geography.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Jurisdiction Geo Object for given Jurisdiction Geo Id. + + Retrieve the specified jurisdiction geography. + + :param jurisdiction_geo_id: The jurisdictionGeoId value of the desired jurisdiction geography. (required) + :type jurisdiction_geo_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_jurisdiction_geo_serialize( + jurisdiction_geo_id=jurisdiction_geo_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JurisdictionGeo", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_jurisdiction_geo_serialize( + self, + jurisdiction_geo_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if jurisdiction_geo_id is not None: + _path_params['jurisdictionGeoId'] = jurisdiction_geo_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/jurisdictionGeo/{jurisdictionGeoId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_jurisdiction_geo_for_court( + self, + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> JurisdictionGeoResponse: + """Jurisdiction Geo Objects for given courtId. + + Retrieve the jurisdiction geography object for the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_jurisdiction_geo_for_court_serialize( + court_id=court_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JurisdictionGeoResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_jurisdiction_geo_for_court_with_http_info( + self, + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JurisdictionGeoResponse]: + """Jurisdiction Geo Objects for given courtId. + + Retrieve the jurisdiction geography object for the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_jurisdiction_geo_for_court_serialize( + court_id=court_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JurisdictionGeoResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_jurisdiction_geo_for_court_without_preload_content( + self, + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Jurisdiction Geo Objects for given courtId. + + Retrieve the jurisdiction geography object for the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_jurisdiction_geo_for_court_serialize( + court_id=court_id, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JurisdictionGeoResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_jurisdiction_geo_for_court_serialize( + self, + court_id, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if court_id is not None: + _path_params['courtId'] = court_id + # process the query parameters + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/court/{courtId}/jurisdictionGeo', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_jurisdictions_geo( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired jurisdiction geography. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> JurisdictionGeoResponse: + """Jurisdiction Geo Object. + + Retrieve one or more jurisdiction geographies using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JurisdictionGeoQueryObject + + :param q: The keyword expression targeting the desired jurisdiction geography. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_jurisdictions_geo_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JurisdictionGeoResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_jurisdictions_geo_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired jurisdiction geography. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JurisdictionGeoResponse]: + """Jurisdiction Geo Object. + + Retrieve one or more jurisdiction geographies using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JurisdictionGeoQueryObject + + :param q: The keyword expression targeting the desired jurisdiction geography. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_jurisdictions_geo_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JurisdictionGeoResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_jurisdictions_geo_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired jurisdiction geography. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Jurisdiction Geo Object. + + Retrieve one or more jurisdiction geographies using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JurisdictionGeoQueryObject + + :param q: The keyword expression targeting the desired jurisdiction geography. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_jurisdictions_geo_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JurisdictionGeoResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_jurisdictions_geo_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/jurisdictionGeo', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_party_role( + self, + party_role_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The partyRoleId value of the desired party role.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PartyRole: + """Party Role Object. + + Retrieve the specified party role. + + :param party_role_id: The partyRoleId value of the desired party role. (required) + :type party_role_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_role_serialize( + party_role_id=party_role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyRole", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_party_role_with_http_info( + self, + party_role_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The partyRoleId value of the desired party role.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PartyRole]: + """Party Role Object. + + Retrieve the specified party role. + + :param party_role_id: The partyRoleId value of the desired party role. (required) + :type party_role_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_role_serialize( + party_role_id=party_role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyRole", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_party_role_without_preload_content( + self, + party_role_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The partyRoleId value of the desired party role.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Party Role Object. + + Retrieve the specified party role. + + :param party_role_id: The partyRoleId value of the desired party role. (required) + :type party_role_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_role_serialize( + party_role_id=party_role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyRole", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_party_role_serialize( + self, + party_role_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if party_role_id is not None: + _path_params['partyRoleId'] = party_role_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/partyRole/{partyRoleId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_party_role_group( + self, + party_role_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The partyRoleGroupId value of the desired party role group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PartyRoleGroup: + """Party Role Group Object. + + Retrieve the specified party role group. + + :param party_role_group_id: The partyRoleGroupId value of the desired party role group. (required) + :type party_role_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_role_group_serialize( + party_role_group_id=party_role_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyRoleGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_party_role_group_with_http_info( + self, + party_role_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The partyRoleGroupId value of the desired party role group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PartyRoleGroup]: + """Party Role Group Object. + + Retrieve the specified party role group. + + :param party_role_group_id: The partyRoleGroupId value of the desired party role group. (required) + :type party_role_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_role_group_serialize( + party_role_group_id=party_role_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyRoleGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_party_role_group_without_preload_content( + self, + party_role_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The partyRoleGroupId value of the desired party role group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Party Role Group Object. + + Retrieve the specified party role group. + + :param party_role_group_id: The partyRoleGroupId value of the desired party role group. (required) + :type party_role_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_role_group_serialize( + party_role_group_id=party_role_group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyRoleGroup", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_party_role_group_serialize( + self, + party_role_group_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if party_role_group_id is not None: + _path_params['partyRoleGroupId'] = party_role_group_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/partyRoleGroup/{partyRoleGroupId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_party_role_groups( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party role group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PartyRoleGroupResponse: + """Party Role Group Object. + + Retrieve a party role group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleGroupQueryObject + + :param q: The keyword expression targeting the desired party role group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_role_groups_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyRoleGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_party_role_groups_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party role group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PartyRoleGroupResponse]: + """Party Role Group Object. + + Retrieve a party role group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleGroupQueryObject + + :param q: The keyword expression targeting the desired party role group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_role_groups_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyRoleGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_party_role_groups_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party role group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Party Role Group Object. + + Retrieve a party role group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleGroupQueryObject + + :param q: The keyword expression targeting the desired party role group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_role_groups_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyRoleGroupResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_party_role_groups_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/partyRoleGroup', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_party_roles( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party role. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PartyRoleResponse: + """Party Role Object. + + Retrieve a party role using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleQueryObject + + :param q: The keyword expression targeting the desired party role. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_roles_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyRoleResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_party_roles_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party role. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PartyRoleResponse]: + """Party Role Object. + + Retrieve a party role using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleQueryObject + + :param q: The keyword expression targeting the desired party role. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_roles_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyRoleResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_party_roles_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party role. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Party Role Object. + + Retrieve a party role using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleQueryObject + + :param q: The keyword expression targeting the desired party role. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_party_roles_serialize( + q=q, + page_number=page_number, + sort=sort, + order=order, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PartyRoleResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_party_roles_serialize( + self, + q, + page_number, + sort, + order, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/masterData/partyRole', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - def get_party_roles( - self, - **kwargs - ): - """Party Role Object. # noqa: E501 - - Retrieve a party role using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleQueryObject # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_party_roles(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired party role. . [optional] - page_number (int): The page number of the results to be retrieved. - minimum: 1 - maximum: 100 . [optional] - sort (str): The field according to which search results are to be sorted.. [optional] if omitted the server will use the default value of "name" - order (str): Whether search results are to be shown in ascending or descending order.. [optional] if omitted the server will use the default value of "asc" - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PartyRoleResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_party_roles_endpoint.call_with_http_info(**kwargs) diff --git a/unicourt/api/judge_analytics_api.py b/unicourt/api/judge_analytics_api.py index 088afbe..06b8a50 100644 --- a/unicourt/api/judge_analytics_api.py +++ b/unicourt/api/judge_analytics_api.py @@ -1,958 +1,1759 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated from unicourt.model.associated_norm_attorney_response import AssociatedNormAttorneyResponse from unicourt.model.associated_norm_law_firm_response import AssociatedNormLawFirmResponse from unicourt.model.associated_norm_party_response import AssociatedNormPartyResponse -from unicourt.model.exception import Exception from unicourt.model.norm_judge import NormJudge from unicourt.model.norm_judge_search_response import NormJudgeSearchResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType + -class JudgeAnalyticsApi(object): +class JudgeAnalyticsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_norm_attorneys_associated_with_norm_judge_endpoint = _Endpoint( - settings={ - 'response_type': (AssociatedNormAttorneyResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normJudge/{normJudgeId}/associatedNormAttorneys', - 'operation_id': 'get_norm_attorneys_associated_with_norm_judge', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_judge_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_judge_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_judge_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_judge_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_judge_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_judge_id': 'normJudgeId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_judge_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_norm_judge_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (NormJudge,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normJudge/{normJudgeId}', - 'operation_id': 'get_norm_judge_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_judge_id', - ], - 'required': [ - 'norm_judge_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_judge_id', - ] - }, - root_map={ - 'validations': { - ('norm_judge_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_judge_id': - (str,), - }, - 'attribute_map': { - 'norm_judge_id': 'normJudgeId', - }, - 'location_map': { - 'norm_judge_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_norm_law_firms_associated_with_norm_judge_endpoint = _Endpoint( - settings={ - 'response_type': (AssociatedNormLawFirmResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normJudge/{normJudgeId}/associatedNormLawFirms', - 'operation_id': 'get_norm_law_firms_associated_with_norm_judge', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_judge_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_judge_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_judge_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_judge_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_judge_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_judge_id': 'normJudgeId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_judge_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_norm_parties_associated_with_norm_judge_endpoint = _Endpoint( - settings={ - 'response_type': (AssociatedNormPartyResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normJudge/{normJudgeId}/associatedNormParties', - 'operation_id': 'get_norm_parties_associated_with_norm_judge', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_judge_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_judge_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_judge_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_judge_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_judge_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_judge_id': 'normJudgeId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_judge_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.search_normalized_judges_endpoint = _Endpoint( - settings={ - 'response_type': (NormJudgeSearchResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normJudgeSearch', - 'operation_id': 'search_normalized_judges', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 1000, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.search_normalized_judges_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (NormJudgeSearchResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normJudgeSearch/{normJudgeSearchId}', - 'operation_id': 'search_normalized_judges_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_judge_search_id', - 'page_number', - ], - 'required': [ - 'norm_judge_search_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_judge_search_id', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_judge_search_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('page_number',): { - - 'inclusive_maximum': 1000, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_judge_search_id': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_judge_search_id': 'normJudgeSearchId', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_judge_search_id': 'path', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def get_norm_attorneys_associated_with_norm_judge( + self, + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssociatedNormAttorneyResponse: + """Attorneys Associated with the Judge. + + Search for attorneys who have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_attorneys_associated_with_norm_judge_serialize( + norm_judge_id=norm_judge_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_attorneys_associated_with_norm_judge_with_http_info( + self, + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormAttorneyResponse]: + """Attorneys Associated with the Judge. + + Search for attorneys who have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_attorneys_associated_with_norm_judge_serialize( + norm_judge_id=norm_judge_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_attorneys_associated_with_norm_judge_without_preload_content( + self, + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Attorneys Associated with the Judge. + + Search for attorneys who have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_attorneys_associated_with_norm_judge_serialize( + norm_judge_id=norm_judge_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_attorneys_associated_with_norm_judge_serialize( self, norm_judge_id, - **kwargs - ): - """Attorneys Associated with the Judge. # noqa: E501 - - Search for attorneys who have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

# noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_attorneys_associated_with_norm_judge(norm_judge_id, async_req=True) - >>> result = thread.get() - - Args: - norm_judge_id (str): The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The keyword expression targeting the desired attorneys.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AssociatedNormAttorneyResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_judge_id'] = \ - norm_judge_id - return self.get_norm_attorneys_associated_with_norm_judge_endpoint.call_with_http_info(**kwargs) + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_judge_id is not None: + _path_params['normJudgeId'] = norm_judge_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normJudge/{normJudgeId}/associatedNormAttorneys', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_norm_judge_by_id( + self, + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NormJudge: + """Norm Judge Details. + + Retrieve the specified judge. + + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_judge_by_id_serialize( + norm_judge_id=norm_judge_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormJudge", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_judge_by_id_with_http_info( + self, + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormJudge]: + """Norm Judge Details. + + Retrieve the specified judge. + + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_judge_by_id_serialize( + norm_judge_id=norm_judge_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormJudge", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_judge_by_id_without_preload_content( + self, + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Norm Judge Details. + + Retrieve the specified judge. + + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_judge_by_id_serialize( + norm_judge_id=norm_judge_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormJudge", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_judge_by_id_serialize( self, norm_judge_id, - **kwargs - ): - """Norm Judge Details. # noqa: E501 - - Retrieve the specified judge. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_judge_by_id(norm_judge_id, async_req=True) - >>> result = thread.get() - - Args: - norm_judge_id (str): The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NormJudge - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_judge_id'] = \ - norm_judge_id - return self.get_norm_judge_by_id_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_judge_id is not None: + _path_params['normJudgeId'] = norm_judge_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normJudge/{normJudgeId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_norm_law_firms_associated_with_norm_judge( + self, + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired law firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssociatedNormLawFirmResponse: + """Law Firms Associated With the Judge. + + Search for law firms that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLOPUfJRhw5yPxgRi\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Law Firms associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_law_firms_associated_with_norm_judge_serialize( + norm_judge_id=norm_judge_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_law_firms_associated_with_norm_judge_with_http_info( + self, + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired law firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormLawFirmResponse]: + """Law Firms Associated With the Judge. + + Search for law firms that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLOPUfJRhw5yPxgRi\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Law Firms associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_law_firms_associated_with_norm_judge_serialize( + norm_judge_id=norm_judge_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_law_firms_associated_with_norm_judge_without_preload_content( + self, + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired law firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Law Firms Associated With the Judge. + + Search for law firms that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLOPUfJRhw5yPxgRi\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Law Firms associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_law_firms_associated_with_norm_judge_serialize( + norm_judge_id=norm_judge_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_law_firms_associated_with_norm_judge_serialize( self, norm_judge_id, - **kwargs - ): - """Law Firms Associated With the Judge. # noqa: E501 - - Search for law firms that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLOPUfJRhw5yPxgRi\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Law Firms associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

# noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_law_firms_associated_with_norm_judge(norm_judge_id, async_req=True) - >>> result = thread.get() - - Args: - norm_judge_id (str): The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The keyword expression targeting the desired law firms.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AssociatedNormLawFirmResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_judge_id'] = \ - norm_judge_id - return self.get_norm_law_firms_associated_with_norm_judge_endpoint.call_with_http_info(**kwargs) + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_judge_id is not None: + _path_params['normJudgeId'] = norm_judge_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normJudge/{normJudgeId}/associatedNormLawFirms', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_norm_parties_associated_with_norm_judge( + self, + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssociatedNormPartyResponse: + """Parties Associated with the Judge. + + Search for parties that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Parties associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired parties. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_parties_associated_with_norm_judge_serialize( + norm_judge_id=norm_judge_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_parties_associated_with_norm_judge_with_http_info( + self, + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormPartyResponse]: + """Parties Associated with the Judge. + + Search for parties that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Parties associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired parties. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_parties_associated_with_norm_judge_serialize( + norm_judge_id=norm_judge_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_parties_associated_with_norm_judge_without_preload_content( + self, + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Parties Associated with the Judge. + + Search for parties that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Parties associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired parties. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_parties_associated_with_norm_judge_serialize( + norm_judge_id=norm_judge_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_parties_associated_with_norm_judge_serialize( self, norm_judge_id, - **kwargs - ): - """Parties Associated with the Judge. # noqa: E501 - - Search for parties that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Parties associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

# noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_parties_associated_with_norm_judge(norm_judge_id, async_req=True) - >>> result = thread.get() - - Args: - norm_judge_id (str): The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The keyword expression targeting the desired parties.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AssociatedNormPartyResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_judge_id'] = \ - norm_judge_id - return self.get_norm_parties_associated_with_norm_judge_endpoint.call_with_http_info(**kwargs) + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_judge_id is not None: + _path_params['normJudgeId'] = norm_judge_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normJudge/{normJudgeId}/associatedNormParties', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def search_normalized_judges( self, - **kwargs - ): - """Judge search. # noqa: E501 - - ### Search for a judge using a keyword expression. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.search_normalized_judges(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired judge. . [optional] - page_number (int): The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NormJudgeSearchResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.search_normalized_judges_endpoint.call_with_http_info(**kwargs) + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired judge. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NormJudgeSearchResponse: + """Judge search. + + ### Search for a judge using a keyword expression. + + :param q: The keyword expression targeting the desired judge. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_judges_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormJudgeSearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def search_normalized_judges_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired judge. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormJudgeSearchResponse]: + """Judge search. + + ### Search for a judge using a keyword expression. + + :param q: The keyword expression targeting the desired judge. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_judges_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormJudgeSearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def search_normalized_judges_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired judge. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Judge search. + + ### Search for a judge using a keyword expression. + + :param q: The keyword expression targeting the desired judge. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_judges_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormJudgeSearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _search_normalized_judges_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normJudgeSearch', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def search_normalized_judges_by_id( + self, + norm_judge_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeSearchId value of the desired search.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NormJudgeSearchResponse: + """Norm judge search results for a given normJudgeSearchId. + + ### Retrieve the desired search for a judge. + + :param norm_judge_search_id: The normJudgeSearchId value of the desired search. (required) + :type norm_judge_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_judges_by_id_serialize( + norm_judge_search_id=norm_judge_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormJudgeSearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def search_normalized_judges_by_id_with_http_info( + self, + norm_judge_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeSearchId value of the desired search.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormJudgeSearchResponse]: + """Norm judge search results for a given normJudgeSearchId. + + ### Retrieve the desired search for a judge. + + :param norm_judge_search_id: The normJudgeSearchId value of the desired search. (required) + :type norm_judge_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_judges_by_id_serialize( + norm_judge_search_id=norm_judge_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormJudgeSearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def search_normalized_judges_by_id_without_preload_content( + self, + norm_judge_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeSearchId value of the desired search.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Norm judge search results for a given normJudgeSearchId. + + ### Retrieve the desired search for a judge. + + :param norm_judge_search_id: The normJudgeSearchId value of the desired search. (required) + :type norm_judge_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_judges_by_id_serialize( + norm_judge_search_id=norm_judge_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormJudgeSearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _search_normalized_judges_by_id_serialize( self, norm_judge_search_id, - **kwargs - ): - """Norm judge search results for a given normJudgeSearchId. # noqa: E501 - - ### Retrieve the desired search for a judge. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.search_normalized_judges_by_id(norm_judge_search_id, async_req=True) - >>> result = thread.get() - - Args: - norm_judge_search_id (str): The normJudgeSearchId value of the desired search. - - Keyword Args: - page_number (int): The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NormJudgeSearchResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_judge_search_id'] = \ - norm_judge_search_id - return self.search_normalized_judges_by_id_endpoint.call_with_http_info(**kwargs) + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_judge_search_id is not None: + _path_params['normJudgeSearchId'] = norm_judge_search_id + # process the query parameters + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normJudgeSearch/{normJudgeSearchId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + diff --git a/unicourt/api/law_firm_analytics_api.py b/unicourt/api/law_firm_analytics_api.py index bf3fb54..482e56a 100644 --- a/unicourt/api/law_firm_analytics_api.py +++ b/unicourt/api/law_firm_analytics_api.py @@ -1,958 +1,1759 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated from unicourt.model.associated_norm_attorney_response import AssociatedNormAttorneyResponse from unicourt.model.associated_norm_judge_response import AssociatedNormJudgeResponse from unicourt.model.associated_norm_party_response import AssociatedNormPartyResponse -from unicourt.model.exception import Exception from unicourt.model.norm_law_firm import NormLawFirm from unicourt.model.norm_law_firm_search_response import NormLawFirmSearchResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType + -class LawFirmAnalyticsApi(object): +class LawFirmAnalyticsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_norm_attorneys_associated_with_norm_law_firm_endpoint = _Endpoint( - settings={ - 'response_type': (AssociatedNormAttorneyResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normLawFirm/{normLawFirmId}/associatedNormAttorneys', - 'operation_id': 'get_norm_attorneys_associated_with_norm_law_firm', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_law_firm_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_law_firm_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_law_firm_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_law_firm_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_law_firm_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_law_firm_id': 'normLawFirmId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_law_firm_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_norm_judges_associated_with_norm_law_firm_endpoint = _Endpoint( - settings={ - 'response_type': (AssociatedNormJudgeResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normLawFirm/{normLawFirmId}/associatedNormJudges', - 'operation_id': 'get_norm_judges_associated_with_norm_law_firm', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_law_firm_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_law_firm_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_law_firm_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_law_firm_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_law_firm_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_law_firm_id': 'normLawFirmId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_law_firm_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_norm_law_firm_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (NormLawFirm,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normLawFirm/{normLawFirmId}', - 'operation_id': 'get_norm_law_firm_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_law_firm_id', - ], - 'required': [ - 'norm_law_firm_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_law_firm_id', - ] - }, - root_map={ - 'validations': { - ('norm_law_firm_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_law_firm_id': - (str,), - }, - 'attribute_map': { - 'norm_law_firm_id': 'normLawFirmId', - }, - 'location_map': { - 'norm_law_firm_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_norm_parties_associated_with_norm_law_firm_endpoint = _Endpoint( - settings={ - 'response_type': (AssociatedNormPartyResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normLawFirm/{normLawFirmId}/associatedNormParties', - 'operation_id': 'get_norm_parties_associated_with_norm_law_firm', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_law_firm_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_law_firm_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_law_firm_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_law_firm_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_law_firm_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_law_firm_id': 'normLawFirmId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_law_firm_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.search_normalized_law_firms_endpoint = _Endpoint( - settings={ - 'response_type': (NormLawFirmSearchResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normLawFirmSearch', - 'operation_id': 'search_normalized_law_firms', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 1000, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.search_normalized_law_firms_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (NormLawFirmSearchResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normLawFirmSearch/{normLawFirmSearchId}', - 'operation_id': 'search_normalized_law_firms_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_law_firm_search_id', - 'page_number', - ], - 'required': [ - 'norm_law_firm_search_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_law_firm_search_id', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_law_firm_search_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('page_number',): { - - 'inclusive_maximum': 1000, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_law_firm_search_id': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_law_firm_search_id': 'normLawFirmSearchId', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_law_firm_search_id': 'path', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def get_norm_attorneys_associated_with_norm_law_firm( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssociatedNormAttorneyResponse: + """Attorneys working for the Law Firm. + + Retrieve the attorneys associated with a given normalized law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired attorneys. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_attorneys_associated_with_norm_law_firm_serialize( + norm_law_firm_id=norm_law_firm_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_attorneys_associated_with_norm_law_firm_with_http_info( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormAttorneyResponse]: + """Attorneys working for the Law Firm. + + Retrieve the attorneys associated with a given normalized law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired attorneys. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_attorneys_associated_with_norm_law_firm_serialize( + norm_law_firm_id=norm_law_firm_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_attorneys_associated_with_norm_law_firm_without_preload_content( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Attorneys working for the Law Firm. + + Retrieve the attorneys associated with a given normalized law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired attorneys. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_attorneys_associated_with_norm_law_firm_serialize( + norm_law_firm_id=norm_law_firm_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_attorneys_associated_with_norm_law_firm_serialize( self, norm_law_firm_id, - **kwargs - ): - """Attorneys working for the Law Firm. # noqa: E501 - - Retrieve the attorneys associated with a given normalized law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

# noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_attorneys_associated_with_norm_law_firm(norm_law_firm_id, async_req=True) - >>> result = thread.get() - - Args: - norm_law_firm_id (str): The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The keyword expression targeting the desired attorneys. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AssociatedNormAttorneyResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_law_firm_id'] = \ - norm_law_firm_id - return self.get_norm_attorneys_associated_with_norm_law_firm_endpoint.call_with_http_info(**kwargs) + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_law_firm_id is not None: + _path_params['normLawFirmId'] = norm_law_firm_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normLawFirm/{normLawFirmId}/associatedNormAttorneys', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_norm_judges_associated_with_norm_law_firm( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssociatedNormJudgeResponse: + """Judges Faced By the Law Firm. + + Retrieve the judges before which a given normalized law firm has appeared.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_judges_associated_with_norm_law_firm_serialize( + norm_law_firm_id=norm_law_firm_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormJudgeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_judges_associated_with_norm_law_firm_with_http_info( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormJudgeResponse]: + """Judges Faced By the Law Firm. + + Retrieve the judges before which a given normalized law firm has appeared.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_judges_associated_with_norm_law_firm_serialize( + norm_law_firm_id=norm_law_firm_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormJudgeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_judges_associated_with_norm_law_firm_without_preload_content( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Judges Faced By the Law Firm. + + Retrieve the judges before which a given normalized law firm has appeared.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_judges_associated_with_norm_law_firm_serialize( + norm_law_firm_id=norm_law_firm_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormJudgeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_judges_associated_with_norm_law_firm_serialize( self, norm_law_firm_id, - **kwargs - ): - """Judges Faced By the Law Firm. # noqa: E501 - - Retrieve the judges before which a given normalized law firm has appeared.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

# noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_judges_associated_with_norm_law_firm(norm_law_firm_id, async_req=True) - >>> result = thread.get() - - Args: - norm_law_firm_id (str): The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AssociatedNormJudgeResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_law_firm_id'] = \ - norm_law_firm_id - return self.get_norm_judges_associated_with_norm_law_firm_endpoint.call_with_http_info(**kwargs) + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_law_firm_id is not None: + _path_params['normLawFirmId'] = norm_law_firm_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normLawFirm/{normLawFirmId}/associatedNormJudges', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_norm_law_firm_by_id( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NormLawFirm: + """Norm LawFirm Details. + + Retrieve the specified normalized law firm. + + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_law_firm_by_id_serialize( + norm_law_firm_id=norm_law_firm_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormLawFirm", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_law_firm_by_id_with_http_info( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormLawFirm]: + """Norm LawFirm Details. + + Retrieve the specified normalized law firm. + + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_law_firm_by_id_serialize( + norm_law_firm_id=norm_law_firm_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormLawFirm", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_law_firm_by_id_without_preload_content( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Norm LawFirm Details. + + Retrieve the specified normalized law firm. + + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_law_firm_by_id_serialize( + norm_law_firm_id=norm_law_firm_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormLawFirm", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_law_firm_by_id_serialize( self, norm_law_firm_id, - **kwargs - ): - """Norm LawFirm Details. # noqa: E501 - - Retrieve the specified normalized law firm. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_law_firm_by_id(norm_law_firm_id, async_req=True) - >>> result = thread.get() - - Args: - norm_law_firm_id (str): The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NormLawFirm - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_law_firm_id'] = \ - norm_law_firm_id - return self.get_norm_law_firm_by_id_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_law_firm_id is not None: + _path_params['normLawFirmId'] = norm_law_firm_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normLawFirm/{normLawFirmId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_norm_parties_associated_with_norm_law_firm( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssociatedNormPartyResponse: + """Parties Represented by the Law Firm. + + Retrieve the parties that the given normalized law firm has represented. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_parties_associated_with_norm_law_firm_serialize( + norm_law_firm_id=norm_law_firm_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_parties_associated_with_norm_law_firm_with_http_info( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormPartyResponse]: + """Parties Represented by the Law Firm. + + Retrieve the parties that the given normalized law firm has represented. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_parties_associated_with_norm_law_firm_serialize( + norm_law_firm_id=norm_law_firm_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_parties_associated_with_norm_law_firm_without_preload_content( + self, + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Parties Represented by the Law Firm. + + Retrieve the parties that the given normalized law firm has represented. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_parties_associated_with_norm_law_firm_serialize( + norm_law_firm_id=norm_law_firm_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormPartyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_parties_associated_with_norm_law_firm_serialize( self, norm_law_firm_id, - **kwargs - ): - """Parties Represented by the Law Firm. # noqa: E501 - - Retrieve the parties that the given normalized law firm has represented. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

# noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_parties_associated_with_norm_law_firm(norm_law_firm_id, async_req=True) - >>> result = thread.get() - - Args: - norm_law_firm_id (str): The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AssociatedNormPartyResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_law_firm_id'] = \ - norm_law_firm_id - return self.get_norm_parties_associated_with_norm_law_firm_endpoint.call_with_http_info(**kwargs) + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_law_firm_id is not None: + _path_params['normLawFirmId'] = norm_law_firm_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normLawFirm/{normLawFirmId}/associatedNormParties', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def search_normalized_law_firms( self, - **kwargs - ): - """Law firm search. # noqa: E501 - - ### Retrieve a normalized law firm using a keyword expression. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.search_normalized_law_firms(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired law firms. . [optional] - page_number (int): The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NormLawFirmSearchResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.search_normalized_law_firms_endpoint.call_with_http_info(**kwargs) + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired law firms. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NormLawFirmSearchResponse: + """Law firm search. + + ### Retrieve a normalized law firm using a keyword expression. + + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_law_firms_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormLawFirmSearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def search_normalized_law_firms_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired law firms. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormLawFirmSearchResponse]: + """Law firm search. + + ### Retrieve a normalized law firm using a keyword expression. + + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_law_firms_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormLawFirmSearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def search_normalized_law_firms_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired law firms. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Law firm search. + + ### Retrieve a normalized law firm using a keyword expression. + + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_law_firms_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormLawFirmSearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _search_normalized_law_firms_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normLawFirmSearch', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def search_normalized_law_firms_by_id( + self, + norm_law_firm_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmSearchId value of the search to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NormLawFirmSearchResponse: + """Norm law firm search result for a given normLawFirmSearchId. + + ### Retrieve the specified search for a normalized law firm. + + :param norm_law_firm_search_id: The normLawFirmSearchId value of the search to be retrieved. (required) + :type norm_law_firm_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_law_firms_by_id_serialize( + norm_law_firm_search_id=norm_law_firm_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormLawFirmSearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def search_normalized_law_firms_by_id_with_http_info( + self, + norm_law_firm_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmSearchId value of the search to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormLawFirmSearchResponse]: + """Norm law firm search result for a given normLawFirmSearchId. + + ### Retrieve the specified search for a normalized law firm. + + :param norm_law_firm_search_id: The normLawFirmSearchId value of the search to be retrieved. (required) + :type norm_law_firm_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_law_firms_by_id_serialize( + norm_law_firm_search_id=norm_law_firm_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormLawFirmSearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def search_normalized_law_firms_by_id_without_preload_content( + self, + norm_law_firm_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmSearchId value of the search to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Norm law firm search result for a given normLawFirmSearchId. + + ### Retrieve the specified search for a normalized law firm. + + :param norm_law_firm_search_id: The normLawFirmSearchId value of the search to be retrieved. (required) + :type norm_law_firm_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_law_firms_by_id_serialize( + norm_law_firm_search_id=norm_law_firm_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormLawFirmSearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _search_normalized_law_firms_by_id_serialize( self, norm_law_firm_search_id, - **kwargs - ): - """Norm law firm search result for a given normLawFirmSearchId. # noqa: E501 - - ### Retrieve the specified search for a normalized law firm. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.search_normalized_law_firms_by_id(norm_law_firm_search_id, async_req=True) - >>> result = thread.get() - - Args: - norm_law_firm_search_id (str): The normLawFirmSearchId value of the search to be retrieved. - - Keyword Args: - page_number (int): The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NormLawFirmSearchResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_law_firm_search_id'] = \ - norm_law_firm_search_id - return self.search_normalized_law_firms_by_id_endpoint.call_with_http_info(**kwargs) + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_law_firm_search_id is not None: + _path_params['normLawFirmSearchId'] = norm_law_firm_search_id + # process the query parameters + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normLawFirmSearch/{normLawFirmSearchId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + diff --git a/unicourt/api/pacer_api.py b/unicourt/api/pacer_api.py index f0018ea..da63f87 100644 --- a/unicourt/api/pacer_api.py +++ b/unicourt/api/pacer_api.py @@ -1,4638 +1,8413 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from unicourt.model.exception import Exception +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from datetime import datetime +from pydantic import Field, StrictBool, StrictInt, field_validator +from typing import List, Optional +from typing_extensions import Annotated from unicourt.model.pacer_import_case import PACERImportCase from unicourt.model.pcl_case import PCLCase from unicourt.model.pcl_party import PCLParty +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType + -class PACERApi(object): +class PACERApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.all_courts_pacer_case_locator_case_search_endpoint = _Endpoint( - settings={ - 'response_type': (PCLCase,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCaseLocator/caseSearch/allCourts', - 'operation_id': 'all_courts_pacer_case_locator_case_search', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'pacer_case_id', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_type_array', - 'court_region_id_array', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - 'page_number', - ], - 'required': [ - 'pacer_user_id', - 'pacer_client_code', - ], - 'nullable': [ - 'case_number', - 'case_title', - 'case_year', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ], - 'enum': [ - 'case_status', - ], - 'validation': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 20, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 1, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('case_title',): { - 'max_length': 255, - }, - ('case_office',): { - - }, - ('case_sequence_number',): { - - }, - ('case_year',): { - - }, - ('case_filed_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_filed_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('sort_parameter_query',): { - 'max_length': 100, - 'min_length': 5, - }, - ('case_status',): { - 'max_length': 100, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('case_status',): { - 'None': None, - "OPEN": "open", - "CLOSED": "closed" - }, - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - 'pacer_client_code': - (str,), - 'case_number': - (str, none_type,), - 'pacer_case_id': - (int,), - 'case_title': - (str, none_type,), - 'case_office': - (int,), - 'case_sequence_number': - (int,), - 'case_year': - (int, none_type,), - 'case_type_array': - ([str, none_type],), - 'court_region_id_array': - ([str, none_type],), - 'case_filed_start_date': - (datetime, none_type,), - 'case_filed_end_date': - (datetime, none_type,), - 'case_terminated_start_date': - (datetime, none_type,), - 'case_terminated_end_date': - (datetime, none_type,), - 'sort_parameter_query': - (str, none_type,), - 'case_status': - (str, none_type,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - 'pacer_client_code': 'pacerClientCode', - 'case_number': 'caseNumber', - 'pacer_case_id': 'pacerCaseId', - 'case_title': 'caseTitle', - 'case_office': 'caseOffice', - 'case_sequence_number': 'caseSequenceNumber', - 'case_year': 'caseYear', - 'case_type_array': 'caseTypeArray', - 'court_region_id_array': 'courtRegionIdArray', - 'case_filed_start_date': 'caseFiledStartDate', - 'case_filed_end_date': 'caseFiledEndDate', - 'case_terminated_start_date': 'caseTerminatedStartDate', - 'case_terminated_end_date': 'caseTerminatedEndDate', - 'sort_parameter_query': 'sortParameterQuery', - 'case_status': 'caseStatus', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'pacer_user_id': 'query', - 'pacer_client_code': 'query', - 'case_number': 'query', - 'pacer_case_id': 'query', - 'case_title': 'query', - 'case_office': 'query', - 'case_sequence_number': 'query', - 'case_year': 'query', - 'case_type_array': 'query', - 'court_region_id_array': 'query', - 'case_filed_start_date': 'query', - 'case_filed_end_date': 'query', - 'case_terminated_start_date': 'query', - 'case_terminated_end_date': 'query', - 'sort_parameter_query': 'query', - 'case_status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - 'case_type_array': 'multi', - 'court_region_id_array': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.all_courts_pacer_case_locator_party_search_endpoint = _Endpoint( - settings={ - 'response_type': (PCLParty,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCaseLocator/partySearch/allCourts', - 'operation_id': 'all_courts_pacer_case_locator_party_search', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'pacer_case_id', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'party_exact_name_match', - 'party_role_array', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_type_array', - 'court_region_id_array', - 'case_year_from', - 'case_year_to', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - 'page_number', - ], - 'required': [ - 'pacer_user_id', - 'pacer_client_code', - ], - 'nullable': [ - 'case_number', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'case_title', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ], - 'enum': [ - 'case_status', - ], - 'validation': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_year_from', - 'case_year_to', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 20, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 1, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('last_name',): { - 'max_length': 50, - }, - ('first_name',): { - 'max_length': 100, - }, - ('middle_name',): { - 'max_length': 100, - }, - ('generation',): { - 'max_length': 5, - }, - ('party_type',): { - 'max_length': 50, - }, - ('case_title',): { - 'max_length': 255, - }, - ('case_office',): { - - }, - ('case_sequence_number',): { - - }, - ('case_year',): { - - }, - ('case_year_from',): { - - }, - ('case_year_to',): { - - }, - ('case_filed_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_filed_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('sort_parameter_query',): { - 'max_length': 100, - 'min_length': 5, - }, - ('case_status',): { - 'max_length': 100, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('case_status',): { - 'None': None, - "OPEN": "open", - "CLOSED": "closed" - }, - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - 'pacer_client_code': - (str,), - 'case_number': - (str, none_type,), - 'pacer_case_id': - (int,), - 'last_name': - (str, none_type,), - 'first_name': - (str, none_type,), - 'middle_name': - (str, none_type,), - 'generation': - (str, none_type,), - 'party_type': - (str, none_type,), - 'party_exact_name_match': - (bool,), - 'party_role_array': - ([str, none_type],), - 'case_title': - (str, none_type,), - 'case_office': - (int,), - 'case_sequence_number': - (int,), - 'case_year': - (int,), - 'case_type_array': - ([str, none_type],), - 'court_region_id_array': - ([str, none_type],), - 'case_year_from': - (int,), - 'case_year_to': - (int,), - 'case_filed_start_date': - (datetime, none_type,), - 'case_filed_end_date': - (datetime, none_type,), - 'case_terminated_start_date': - (datetime, none_type,), - 'case_terminated_end_date': - (datetime, none_type,), - 'sort_parameter_query': - (str, none_type,), - 'case_status': - (str, none_type,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - 'pacer_client_code': 'pacerClientCode', - 'case_number': 'caseNumber', - 'pacer_case_id': 'pacerCaseId', - 'last_name': 'lastName', - 'first_name': 'firstName', - 'middle_name': 'middleName', - 'generation': 'generation', - 'party_type': 'partyType', - 'party_exact_name_match': 'partyExactNameMatch', - 'party_role_array': 'partyRoleArray', - 'case_title': 'caseTitle', - 'case_office': 'caseOffice', - 'case_sequence_number': 'caseSequenceNumber', - 'case_year': 'caseYear', - 'case_type_array': 'caseTypeArray', - 'court_region_id_array': 'courtRegionIdArray', - 'case_year_from': 'caseYearFrom', - 'case_year_to': 'caseYearTo', - 'case_filed_start_date': 'caseFiledStartDate', - 'case_filed_end_date': 'caseFiledEndDate', - 'case_terminated_start_date': 'caseTerminatedStartDate', - 'case_terminated_end_date': 'caseTerminatedEndDate', - 'sort_parameter_query': 'sortParameterQuery', - 'case_status': 'caseStatus', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'pacer_user_id': 'query', - 'pacer_client_code': 'query', - 'case_number': 'query', - 'pacer_case_id': 'query', - 'last_name': 'query', - 'first_name': 'query', - 'middle_name': 'query', - 'generation': 'query', - 'party_type': 'query', - 'party_exact_name_match': 'query', - 'party_role_array': 'query', - 'case_title': 'query', - 'case_office': 'query', - 'case_sequence_number': 'query', - 'case_year': 'query', - 'case_type_array': 'query', - 'court_region_id_array': 'query', - 'case_year_from': 'query', - 'case_year_to': 'query', - 'case_filed_start_date': 'query', - 'case_filed_end_date': 'query', - 'case_terminated_start_date': 'query', - 'case_terminated_end_date': 'query', - 'sort_parameter_query': 'query', - 'case_status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - 'party_role_array': 'multi', - 'case_type_array': 'multi', - 'court_region_id_array': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.appeal_courts_pacer_case_locator_case_search_endpoint = _Endpoint( - settings={ - 'response_type': (PCLCase,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCaseLocator/caseSearch/appealCourts', - 'operation_id': 'appeal_courts_pacer_case_locator_case_search', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'pacer_case_id', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_type_array', - 'nature_of_suits_array', - 'court_region_id_array', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - 'page_number', - ], - 'required': [ - 'pacer_user_id', - 'pacer_client_code', - ], - 'nullable': [ - 'case_number', - 'case_title', - 'case_office', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ], - 'enum': [ - 'case_status', - ], - 'validation': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 20, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 1, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('case_title',): { - 'max_length': 255, - }, - ('case_office',): { - - }, - ('case_sequence_number',): { - - }, - ('case_year',): { - - }, - ('case_filed_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_filed_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('sort_parameter_query',): { - 'max_length': 100, - 'min_length': 5, - }, - ('case_status',): { - 'max_length': 100, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('case_status',): { - 'None': None, - "OPEN": "open", - "CLOSED": "closed" - }, - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - 'pacer_client_code': - (str,), - 'case_number': - (str, none_type,), - 'pacer_case_id': - (int,), - 'case_title': - (str, none_type,), - 'case_office': - (int, none_type,), - 'case_sequence_number': - (int,), - 'case_year': - (int,), - 'case_type_array': - ([str, none_type],), - 'nature_of_suits_array': - ([str, none_type],), - 'court_region_id_array': - ([str, none_type],), - 'case_filed_start_date': - (datetime, none_type,), - 'case_filed_end_date': - (datetime, none_type,), - 'case_terminated_start_date': - (datetime, none_type,), - 'case_terminated_end_date': - (datetime, none_type,), - 'sort_parameter_query': - (str, none_type,), - 'case_status': - (str, none_type,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - 'pacer_client_code': 'pacerClientCode', - 'case_number': 'caseNumber', - 'pacer_case_id': 'pacerCaseId', - 'case_title': 'caseTitle', - 'case_office': 'caseOffice', - 'case_sequence_number': 'caseSequenceNumber', - 'case_year': 'caseYear', - 'case_type_array': 'caseTypeArray', - 'nature_of_suits_array': 'natureOfSuitsArray', - 'court_region_id_array': 'courtRegionIdArray', - 'case_filed_start_date': 'caseFiledStartDate', - 'case_filed_end_date': 'caseFiledEndDate', - 'case_terminated_start_date': 'caseTerminatedStartDate', - 'case_terminated_end_date': 'caseTerminatedEndDate', - 'sort_parameter_query': 'sortParameterQuery', - 'case_status': 'caseStatus', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'pacer_user_id': 'query', - 'pacer_client_code': 'query', - 'case_number': 'query', - 'pacer_case_id': 'query', - 'case_title': 'query', - 'case_office': 'query', - 'case_sequence_number': 'query', - 'case_year': 'query', - 'case_type_array': 'query', - 'nature_of_suits_array': 'query', - 'court_region_id_array': 'query', - 'case_filed_start_date': 'query', - 'case_filed_end_date': 'query', - 'case_terminated_start_date': 'query', - 'case_terminated_end_date': 'query', - 'sort_parameter_query': 'query', - 'case_status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - 'case_type_array': 'multi', - 'nature_of_suits_array': 'multi', - 'court_region_id_array': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.appeal_courts_pacer_case_locator_party_search_endpoint = _Endpoint( - settings={ - 'response_type': (PCLParty,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCaseLocator/partySearch/appealCourts', - 'operation_id': 'appeal_courts_pacer_case_locator_party_search', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'pacer_case_id', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'party_exact_name_match', - 'party_role_array', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_type_array', - 'court_region_id_array', - 'case_year_from', - 'case_year_to', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - 'page_number', - ], - 'required': [ - 'pacer_user_id', - 'pacer_client_code', - ], - 'nullable': [ - 'case_number', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'case_title', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ], - 'enum': [ - 'case_status', - ], - 'validation': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_year_from', - 'case_year_to', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 20, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 1, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('last_name',): { - 'max_length': 50, - }, - ('first_name',): { - 'max_length': 100, - }, - ('middle_name',): { - 'max_length': 100, - }, - ('generation',): { - 'max_length': 5, - }, - ('party_type',): { - 'max_length': 50, - }, - ('case_title',): { - 'max_length': 255, - }, - ('case_office',): { - - }, - ('case_sequence_number',): { - - }, - ('case_year',): { - - }, - ('case_year_from',): { - - }, - ('case_year_to',): { - - }, - ('case_filed_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_filed_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('sort_parameter_query',): { - 'max_length': 100, - 'min_length': 5, - }, - ('case_status',): { - 'max_length': 100, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('case_status',): { - 'None': None, - "OPEN": "open", - "CLOSED": "closed" - }, - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - 'pacer_client_code': - (str,), - 'case_number': - (str, none_type,), - 'pacer_case_id': - (int,), - 'last_name': - (str, none_type,), - 'first_name': - (str, none_type,), - 'middle_name': - (str, none_type,), - 'generation': - (str, none_type,), - 'party_type': - (str, none_type,), - 'party_exact_name_match': - (bool,), - 'party_role_array': - ([str, none_type],), - 'case_title': - (str, none_type,), - 'case_office': - (int,), - 'case_sequence_number': - (int,), - 'case_year': - (int,), - 'case_type_array': - ([str, none_type],), - 'court_region_id_array': - ([str, none_type],), - 'case_year_from': - (int,), - 'case_year_to': - (int,), - 'case_filed_start_date': - (datetime, none_type,), - 'case_filed_end_date': - (datetime, none_type,), - 'case_terminated_start_date': - (datetime, none_type,), - 'case_terminated_end_date': - (datetime, none_type,), - 'sort_parameter_query': - (str, none_type,), - 'case_status': - (str, none_type,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - 'pacer_client_code': 'pacerClientCode', - 'case_number': 'caseNumber', - 'pacer_case_id': 'pacerCaseId', - 'last_name': 'lastName', - 'first_name': 'firstName', - 'middle_name': 'middleName', - 'generation': 'generation', - 'party_type': 'partyType', - 'party_exact_name_match': 'partyExactNameMatch', - 'party_role_array': 'partyRoleArray', - 'case_title': 'caseTitle', - 'case_office': 'caseOffice', - 'case_sequence_number': 'caseSequenceNumber', - 'case_year': 'caseYear', - 'case_type_array': 'caseTypeArray', - 'court_region_id_array': 'courtRegionIdArray', - 'case_year_from': 'caseYearFrom', - 'case_year_to': 'caseYearTo', - 'case_filed_start_date': 'caseFiledStartDate', - 'case_filed_end_date': 'caseFiledEndDate', - 'case_terminated_start_date': 'caseTerminatedStartDate', - 'case_terminated_end_date': 'caseTerminatedEndDate', - 'sort_parameter_query': 'sortParameterQuery', - 'case_status': 'caseStatus', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'pacer_user_id': 'query', - 'pacer_client_code': 'query', - 'case_number': 'query', - 'pacer_case_id': 'query', - 'last_name': 'query', - 'first_name': 'query', - 'middle_name': 'query', - 'generation': 'query', - 'party_type': 'query', - 'party_exact_name_match': 'query', - 'party_role_array': 'query', - 'case_title': 'query', - 'case_office': 'query', - 'case_sequence_number': 'query', - 'case_year': 'query', - 'case_type_array': 'query', - 'court_region_id_array': 'query', - 'case_year_from': 'query', - 'case_year_to': 'query', - 'case_filed_start_date': 'query', - 'case_filed_end_date': 'query', - 'case_terminated_start_date': 'query', - 'case_terminated_end_date': 'query', - 'sort_parameter_query': 'query', - 'case_status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - 'party_role_array': 'multi', - 'case_type_array': 'multi', - 'court_region_id_array': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.bankruptcy_courts_pacer_case_locator_case_search_endpoint = _Endpoint( - settings={ - 'response_type': (PCLCase,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCaseLocator/caseSearch/bankruptcyCourts', - 'operation_id': 'bankruptcy_courts_pacer_case_locator_case_search', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'pacer_case_id', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_type_array', - 'federal_bankruptcy_chapter_array', - 'court_region_id_array', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'case_discharged_start_date', - 'case_discharged_end_date', - 'case_dismissed_start_date', - 'case_dismissed_end_date', - 'sort_parameter_query', - 'case_status', - 'page_number', - ], - 'required': [ - 'pacer_user_id', - 'pacer_client_code', - ], - 'nullable': [ - 'case_number', - 'case_title', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'case_discharged_start_date', - 'case_discharged_end_date', - 'case_dismissed_start_date', - 'case_dismissed_end_date', - 'sort_parameter_query', - 'case_status', - ], - 'enum': [ - 'case_status', - ], - 'validation': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'case_discharged_start_date', - 'case_discharged_end_date', - 'case_dismissed_start_date', - 'case_dismissed_end_date', - 'sort_parameter_query', - 'case_status', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 20, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 1, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('case_title',): { - 'max_length': 255, - }, - ('case_office',): { - - }, - ('case_sequence_number',): { - - }, - ('case_year',): { - - }, - ('case_filed_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_filed_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_discharged_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_discharged_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_dismissed_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_dismissed_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('sort_parameter_query',): { - 'max_length': 100, - 'min_length': 5, - }, - ('case_status',): { - 'max_length': 100, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('case_status',): { - 'None': None, - "OPEN": "open", - "CLOSED": "closed" - }, - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - 'pacer_client_code': - (str,), - 'case_number': - (str, none_type,), - 'pacer_case_id': - (int,), - 'case_title': - (str, none_type,), - 'case_office': - (int,), - 'case_sequence_number': - (int,), - 'case_year': - (int,), - 'case_type_array': - ([str, none_type],), - 'federal_bankruptcy_chapter_array': - ([str, none_type],), - 'court_region_id_array': - ([str, none_type],), - 'case_filed_start_date': - (datetime, none_type,), - 'case_filed_end_date': - (datetime, none_type,), - 'case_terminated_start_date': - (datetime, none_type,), - 'case_terminated_end_date': - (datetime, none_type,), - 'case_discharged_start_date': - (datetime, none_type,), - 'case_discharged_end_date': - (datetime, none_type,), - 'case_dismissed_start_date': - (datetime, none_type,), - 'case_dismissed_end_date': - (datetime, none_type,), - 'sort_parameter_query': - (str, none_type,), - 'case_status': - (str, none_type,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - 'pacer_client_code': 'pacerClientCode', - 'case_number': 'caseNumber', - 'pacer_case_id': 'pacerCaseId', - 'case_title': 'caseTitle', - 'case_office': 'caseOffice', - 'case_sequence_number': 'caseSequenceNumber', - 'case_year': 'caseYear', - 'case_type_array': 'caseTypeArray', - 'federal_bankruptcy_chapter_array': 'federalBankruptcyChapterArray', - 'court_region_id_array': 'courtRegionIdArray', - 'case_filed_start_date': 'caseFiledStartDate', - 'case_filed_end_date': 'caseFiledEndDate', - 'case_terminated_start_date': 'caseTerminatedStartDate', - 'case_terminated_end_date': 'caseTerminatedEndDate', - 'case_discharged_start_date': 'caseDischargedStartDate', - 'case_discharged_end_date': 'caseDischargedEndDate', - 'case_dismissed_start_date': 'caseDismissedStartDate', - 'case_dismissed_end_date': 'caseDismissedEndDate', - 'sort_parameter_query': 'sortParameterQuery', - 'case_status': 'caseStatus', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'pacer_user_id': 'query', - 'pacer_client_code': 'query', - 'case_number': 'query', - 'pacer_case_id': 'query', - 'case_title': 'query', - 'case_office': 'query', - 'case_sequence_number': 'query', - 'case_year': 'query', - 'case_type_array': 'query', - 'federal_bankruptcy_chapter_array': 'query', - 'court_region_id_array': 'query', - 'case_filed_start_date': 'query', - 'case_filed_end_date': 'query', - 'case_terminated_start_date': 'query', - 'case_terminated_end_date': 'query', - 'case_discharged_start_date': 'query', - 'case_discharged_end_date': 'query', - 'case_dismissed_start_date': 'query', - 'case_dismissed_end_date': 'query', - 'sort_parameter_query': 'query', - 'case_status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - 'case_type_array': 'multi', - 'federal_bankruptcy_chapter_array': 'multi', - 'court_region_id_array': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.bankruptcy_courts_pacer_case_locator_party_search_endpoint = _Endpoint( - settings={ - 'response_type': (PCLParty,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCaseLocator/partySearch/bankruptcyCourts', - 'operation_id': 'bankruptcy_courts_pacer_case_locator_party_search', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'pacer_case_id', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'party_exact_name_match', - 'party_role_array', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_type_array', - 'court_region_id_array', - 'case_year_from', - 'case_year_to', - 'ssn_or_ein', - 'four_digit_ssn', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'case_discharged_start_date', - 'case_discharged_end_date', - 'case_dismissed_start_date', - 'case_dismissed_end_date', - 'sort_parameter_query', - 'case_status', - 'page_number', - ], - 'required': [ - 'pacer_user_id', - 'pacer_client_code', - ], - 'nullable': [ - 'case_number', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'case_title', - 'ssn_or_ein', - 'four_digit_ssn', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'case_discharged_start_date', - 'case_discharged_end_date', - 'case_dismissed_start_date', - 'case_dismissed_end_date', - 'sort_parameter_query', - 'case_status', - ], - 'enum': [ - 'case_status', - ], - 'validation': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_year_from', - 'case_year_to', - 'ssn_or_ein', - 'four_digit_ssn', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'case_discharged_start_date', - 'case_discharged_end_date', - 'case_dismissed_start_date', - 'case_dismissed_end_date', - 'sort_parameter_query', - 'case_status', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 20, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 1, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('last_name',): { - 'max_length': 50, - }, - ('first_name',): { - 'max_length': 100, - }, - ('middle_name',): { - 'max_length': 100, - }, - ('generation',): { - 'max_length': 5, - }, - ('party_type',): { - 'max_length': 50, - }, - ('case_title',): { - 'max_length': 255, - }, - ('case_office',): { - - }, - ('case_sequence_number',): { - - }, - ('case_year',): { - - }, - ('case_year_from',): { - - }, - ('case_year_to',): { - - }, - ('ssn_or_ein',): { - 'max_length': 9, - }, - ('four_digit_ssn',): { - 'max_length': 4, - }, - ('case_filed_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_filed_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_discharged_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_discharged_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_dismissed_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_dismissed_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('sort_parameter_query',): { - 'max_length': 100, - 'min_length': 5, - }, - ('case_status',): { - 'max_length': 100, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('case_status',): { - 'None': None, - "OPEN": "open", - "CLOSED": "closed" - }, - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - 'pacer_client_code': - (str,), - 'case_number': - (str, none_type,), - 'pacer_case_id': - (int,), - 'last_name': - (str, none_type,), - 'first_name': - (str, none_type,), - 'middle_name': - (str, none_type,), - 'generation': - (str, none_type,), - 'party_type': - (str, none_type,), - 'party_exact_name_match': - (bool,), - 'party_role_array': - ([str, none_type],), - 'case_title': - (str, none_type,), - 'case_office': - (int,), - 'case_sequence_number': - (int,), - 'case_year': - (int,), - 'case_type_array': - ([str, none_type],), - 'court_region_id_array': - ([str, none_type],), - 'case_year_from': - (int,), - 'case_year_to': - (int,), - 'ssn_or_ein': - (str, none_type,), - 'four_digit_ssn': - (str, none_type,), - 'case_filed_start_date': - (datetime, none_type,), - 'case_filed_end_date': - (datetime, none_type,), - 'case_terminated_start_date': - (datetime, none_type,), - 'case_terminated_end_date': - (datetime, none_type,), - 'case_discharged_start_date': - (datetime, none_type,), - 'case_discharged_end_date': - (datetime, none_type,), - 'case_dismissed_start_date': - (datetime, none_type,), - 'case_dismissed_end_date': - (datetime, none_type,), - 'sort_parameter_query': - (str, none_type,), - 'case_status': - (str, none_type,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - 'pacer_client_code': 'pacerClientCode', - 'case_number': 'caseNumber', - 'pacer_case_id': 'pacerCaseId', - 'last_name': 'lastName', - 'first_name': 'firstName', - 'middle_name': 'middleName', - 'generation': 'generation', - 'party_type': 'partyType', - 'party_exact_name_match': 'partyExactNameMatch', - 'party_role_array': 'partyRoleArray', - 'case_title': 'caseTitle', - 'case_office': 'caseOffice', - 'case_sequence_number': 'caseSequenceNumber', - 'case_year': 'caseYear', - 'case_type_array': 'caseTypeArray', - 'court_region_id_array': 'courtRegionIdArray', - 'case_year_from': 'caseYearFrom', - 'case_year_to': 'caseYearTo', - 'ssn_or_ein': 'ssnOrEin', - 'four_digit_ssn': 'fourDigitSsn', - 'case_filed_start_date': 'caseFiledStartDate', - 'case_filed_end_date': 'caseFiledEndDate', - 'case_terminated_start_date': 'caseTerminatedStartDate', - 'case_terminated_end_date': 'caseTerminatedEndDate', - 'case_discharged_start_date': 'caseDischargedStartDate', - 'case_discharged_end_date': 'caseDischargedEndDate', - 'case_dismissed_start_date': 'caseDismissedStartDate', - 'case_dismissed_end_date': 'caseDismissedEndDate', - 'sort_parameter_query': 'sortParameterQuery', - 'case_status': 'caseStatus', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'pacer_user_id': 'query', - 'pacer_client_code': 'query', - 'case_number': 'query', - 'pacer_case_id': 'query', - 'last_name': 'query', - 'first_name': 'query', - 'middle_name': 'query', - 'generation': 'query', - 'party_type': 'query', - 'party_exact_name_match': 'query', - 'party_role_array': 'query', - 'case_title': 'query', - 'case_office': 'query', - 'case_sequence_number': 'query', - 'case_year': 'query', - 'case_type_array': 'query', - 'court_region_id_array': 'query', - 'case_year_from': 'query', - 'case_year_to': 'query', - 'ssn_or_ein': 'query', - 'four_digit_ssn': 'query', - 'case_filed_start_date': 'query', - 'case_filed_end_date': 'query', - 'case_terminated_start_date': 'query', - 'case_terminated_end_date': 'query', - 'case_discharged_start_date': 'query', - 'case_discharged_end_date': 'query', - 'case_dismissed_start_date': 'query', - 'case_dismissed_end_date': 'query', - 'sort_parameter_query': 'query', - 'case_status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - 'party_role_array': 'multi', - 'case_type_array': 'multi', - 'court_region_id_array': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.civil_courts_pacer_case_locator_case_search_endpoint = _Endpoint( - settings={ - 'response_type': (PCLCase,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCaseLocator/caseSearch/civilCourts', - 'operation_id': 'civil_courts_pacer_case_locator_case_search', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'pacer_case_id', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_type_array', - 'nature_of_suits_array', - 'court_region_id_array', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - 'page_number', - ], - 'required': [ - 'pacer_user_id', - 'pacer_client_code', - ], - 'nullable': [ - 'case_number', - 'case_title', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ], - 'enum': [ - 'case_status', - ], - 'validation': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 20, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 1, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('case_title',): { - 'max_length': 255, - }, - ('case_office',): { - - }, - ('case_sequence_number',): { - - }, - ('case_year',): { - - }, - ('case_filed_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_filed_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('sort_parameter_query',): { - 'max_length': 100, - 'min_length': 5, - }, - ('case_status',): { - 'max_length': 100, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('case_status',): { - 'None': None, - "OPEN": "open", - "CLOSED": "closed" - }, - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - 'pacer_client_code': - (str,), - 'case_number': - (str, none_type,), - 'pacer_case_id': - (int,), - 'case_title': - (str, none_type,), - 'case_office': - (int,), - 'case_sequence_number': - (int,), - 'case_year': - (int,), - 'case_type_array': - ([str, none_type],), - 'nature_of_suits_array': - ([str, none_type],), - 'court_region_id_array': - ([str, none_type],), - 'case_filed_start_date': - (datetime, none_type,), - 'case_filed_end_date': - (datetime, none_type,), - 'case_terminated_start_date': - (datetime, none_type,), - 'case_terminated_end_date': - (datetime, none_type,), - 'sort_parameter_query': - (str, none_type,), - 'case_status': - (str, none_type,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - 'pacer_client_code': 'pacerClientCode', - 'case_number': 'caseNumber', - 'pacer_case_id': 'pacerCaseId', - 'case_title': 'caseTitle', - 'case_office': 'caseOffice', - 'case_sequence_number': 'caseSequenceNumber', - 'case_year': 'caseYear', - 'case_type_array': 'caseTypeArray', - 'nature_of_suits_array': 'natureOfSuitsArray', - 'court_region_id_array': 'courtRegionIdArray', - 'case_filed_start_date': 'caseFiledStartDate', - 'case_filed_end_date': 'caseFiledEndDate', - 'case_terminated_start_date': 'caseTerminatedStartDate', - 'case_terminated_end_date': 'caseTerminatedEndDate', - 'sort_parameter_query': 'sortParameterQuery', - 'case_status': 'caseStatus', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'pacer_user_id': 'query', - 'pacer_client_code': 'query', - 'case_number': 'query', - 'pacer_case_id': 'query', - 'case_title': 'query', - 'case_office': 'query', - 'case_sequence_number': 'query', - 'case_year': 'query', - 'case_type_array': 'query', - 'nature_of_suits_array': 'query', - 'court_region_id_array': 'query', - 'case_filed_start_date': 'query', - 'case_filed_end_date': 'query', - 'case_terminated_start_date': 'query', - 'case_terminated_end_date': 'query', - 'sort_parameter_query': 'query', - 'case_status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - 'case_type_array': 'multi', - 'nature_of_suits_array': 'multi', - 'court_region_id_array': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + + @validate_call + def all_courts_pacer_case_locator_case_search( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PCLCase: + """PACER Case Locator Search API for All Courts. + + Search all courts within the PACER system for a particular case. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._all_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.civil_courts_pacer_case_locator_party_search_endpoint = _Endpoint( - settings={ - 'response_type': (PCLParty,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCaseLocator/partySearch/civilCourts', - 'operation_id': 'civil_courts_pacer_case_locator_party_search', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'pacer_case_id', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'party_exact_name_match', - 'party_role_array', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_type_array', - 'court_region_id_array', - 'case_year_from', - 'case_year_to', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - 'page_number', - ], - 'required': [ - 'pacer_user_id', - 'pacer_client_code', - ], - 'nullable': [ - 'case_number', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'case_title', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ], - 'enum': [ - 'case_status', - ], - 'validation': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_year_from', - 'case_year_to', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 20, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 1, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('last_name',): { - 'max_length': 50, - }, - ('first_name',): { - 'max_length': 100, - }, - ('middle_name',): { - 'max_length': 100, - }, - ('generation',): { - 'max_length': 5, - }, - ('party_type',): { - 'max_length': 50, - }, - ('case_title',): { - 'max_length': 255, - }, - ('case_office',): { - - }, - ('case_sequence_number',): { - - }, - ('case_year',): { - - }, - ('case_year_from',): { - - }, - ('case_year_to',): { - - }, - ('case_filed_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_filed_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('sort_parameter_query',): { - 'max_length': 100, - 'min_length': 5, - }, - ('case_status',): { - 'max_length': 100, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('case_status',): { - 'None': None, - "OPEN": "open", - "CLOSED": "closed" - }, - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - 'pacer_client_code': - (str,), - 'case_number': - (str, none_type,), - 'pacer_case_id': - (int,), - 'last_name': - (str, none_type,), - 'first_name': - (str, none_type,), - 'middle_name': - (str, none_type,), - 'generation': - (str, none_type,), - 'party_type': - (str, none_type,), - 'party_exact_name_match': - (bool,), - 'party_role_array': - ([str, none_type],), - 'case_title': - (str, none_type,), - 'case_office': - (int,), - 'case_sequence_number': - (int,), - 'case_year': - (int,), - 'case_type_array': - ([str, none_type],), - 'court_region_id_array': - ([str, none_type],), - 'case_year_from': - (int,), - 'case_year_to': - (int,), - 'case_filed_start_date': - (datetime, none_type,), - 'case_filed_end_date': - (datetime, none_type,), - 'case_terminated_start_date': - (datetime, none_type,), - 'case_terminated_end_date': - (datetime, none_type,), - 'sort_parameter_query': - (str, none_type,), - 'case_status': - (str, none_type,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - 'pacer_client_code': 'pacerClientCode', - 'case_number': 'caseNumber', - 'pacer_case_id': 'pacerCaseId', - 'last_name': 'lastName', - 'first_name': 'firstName', - 'middle_name': 'middleName', - 'generation': 'generation', - 'party_type': 'partyType', - 'party_exact_name_match': 'partyExactNameMatch', - 'party_role_array': 'partyRoleArray', - 'case_title': 'caseTitle', - 'case_office': 'caseOffice', - 'case_sequence_number': 'caseSequenceNumber', - 'case_year': 'caseYear', - 'case_type_array': 'caseTypeArray', - 'court_region_id_array': 'courtRegionIdArray', - 'case_year_from': 'caseYearFrom', - 'case_year_to': 'caseYearTo', - 'case_filed_start_date': 'caseFiledStartDate', - 'case_filed_end_date': 'caseFiledEndDate', - 'case_terminated_start_date': 'caseTerminatedStartDate', - 'case_terminated_end_date': 'caseTerminatedEndDate', - 'sort_parameter_query': 'sortParameterQuery', - 'case_status': 'caseStatus', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'pacer_user_id': 'query', - 'pacer_client_code': 'query', - 'case_number': 'query', - 'pacer_case_id': 'query', - 'last_name': 'query', - 'first_name': 'query', - 'middle_name': 'query', - 'generation': 'query', - 'party_type': 'query', - 'party_exact_name_match': 'query', - 'party_role_array': 'query', - 'case_title': 'query', - 'case_office': 'query', - 'case_sequence_number': 'query', - 'case_year': 'query', - 'case_type_array': 'query', - 'court_region_id_array': 'query', - 'case_year_from': 'query', - 'case_year_to': 'query', - 'case_filed_start_date': 'query', - 'case_filed_end_date': 'query', - 'case_terminated_start_date': 'query', - 'case_terminated_end_date': 'query', - 'sort_parameter_query': 'query', - 'case_status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - 'party_role_array': 'multi', - 'case_type_array': 'multi', - 'court_region_id_array': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - self.criminal_courts_pacer_case_locator_case_search_endpoint = _Endpoint( - settings={ - 'response_type': (PCLCase,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCaseLocator/caseSearch/criminalCourts', - 'operation_id': 'criminal_courts_pacer_case_locator_case_search', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'pacer_case_id', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_type_array', - 'court_region_id_array', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - 'page_number', - ], - 'required': [ - 'pacer_user_id', - 'pacer_client_code', - ], - 'nullable': [ - 'case_number', - 'case_title', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ], - 'enum': [ - 'case_status', - ], - 'validation': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 20, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 1, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('case_title',): { - 'max_length': 255, - }, - ('case_office',): { - - }, - ('case_sequence_number',): { - - }, - ('case_year',): { - - }, - ('case_filed_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_filed_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('sort_parameter_query',): { - 'max_length': 100, - 'min_length': 5, - }, - ('case_status',): { - 'max_length': 100, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('case_status',): { - 'None': None, - "OPEN": "open", - "CLOSED": "closed" - }, - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - 'pacer_client_code': - (str,), - 'case_number': - (str, none_type,), - 'pacer_case_id': - (int,), - 'case_title': - (str, none_type,), - 'case_office': - (int,), - 'case_sequence_number': - (int,), - 'case_year': - (int,), - 'case_type_array': - ([str, none_type],), - 'court_region_id_array': - ([str, none_type],), - 'case_filed_start_date': - (datetime, none_type,), - 'case_filed_end_date': - (datetime, none_type,), - 'case_terminated_start_date': - (datetime, none_type,), - 'case_terminated_end_date': - (datetime, none_type,), - 'sort_parameter_query': - (str, none_type,), - 'case_status': - (str, none_type,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - 'pacer_client_code': 'pacerClientCode', - 'case_number': 'caseNumber', - 'pacer_case_id': 'pacerCaseId', - 'case_title': 'caseTitle', - 'case_office': 'caseOffice', - 'case_sequence_number': 'caseSequenceNumber', - 'case_year': 'caseYear', - 'case_type_array': 'caseTypeArray', - 'court_region_id_array': 'courtRegionIdArray', - 'case_filed_start_date': 'caseFiledStartDate', - 'case_filed_end_date': 'caseFiledEndDate', - 'case_terminated_start_date': 'caseTerminatedStartDate', - 'case_terminated_end_date': 'caseTerminatedEndDate', - 'sort_parameter_query': 'sortParameterQuery', - 'case_status': 'caseStatus', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'pacer_user_id': 'query', - 'pacer_client_code': 'query', - 'case_number': 'query', - 'pacer_case_id': 'query', - 'case_title': 'query', - 'case_office': 'query', - 'case_sequence_number': 'query', - 'case_year': 'query', - 'case_type_array': 'query', - 'court_region_id_array': 'query', - 'case_filed_start_date': 'query', - 'case_filed_end_date': 'query', - 'case_terminated_start_date': 'query', - 'case_terminated_end_date': 'query', - 'sort_parameter_query': 'query', - 'case_status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - 'case_type_array': 'multi', - 'court_region_id_array': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def all_courts_pacer_case_locator_case_search_with_http_info( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLCase]: + """PACER Case Locator Search API for All Courts. + + Search all courts within the PACER system for a particular case. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._all_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.criminal_courts_pacer_case_locator_party_search_endpoint = _Endpoint( - settings={ - 'response_type': (PCLParty,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCaseLocator/partySearch/criminalCourts', - 'operation_id': 'criminal_courts_pacer_case_locator_party_search', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'pacer_case_id', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'party_exact_name_match', - 'party_role_array', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_type_array', - 'court_region_id_array', - 'case_year_from', - 'case_year_to', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - 'page_number', - ], - 'required': [ - 'pacer_user_id', - 'pacer_client_code', - ], - 'nullable': [ - 'case_number', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'case_title', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ], - 'enum': [ - 'case_status', - ], - 'validation': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_year_from', - 'case_year_to', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 20, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 1, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('last_name',): { - 'max_length': 50, - }, - ('first_name',): { - 'max_length': 100, - }, - ('middle_name',): { - 'max_length': 100, - }, - ('generation',): { - 'max_length': 5, - }, - ('party_type',): { - 'max_length': 50, - }, - ('case_title',): { - 'max_length': 255, - }, - ('case_office',): { - - }, - ('case_sequence_number',): { - - }, - ('case_year',): { - - }, - ('case_year_from',): { - - }, - ('case_year_to',): { - - }, - ('case_filed_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_filed_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('sort_parameter_query',): { - 'max_length': 100, - 'min_length': 5, - }, - ('case_status',): { - 'max_length': 100, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('case_status',): { - 'None': None, - "OPEN": "open", - "CLOSED": "closed" - }, - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - 'pacer_client_code': - (str,), - 'case_number': - (str, none_type,), - 'pacer_case_id': - (int,), - 'last_name': - (str, none_type,), - 'first_name': - (str, none_type,), - 'middle_name': - (str, none_type,), - 'generation': - (str, none_type,), - 'party_type': - (str, none_type,), - 'party_exact_name_match': - (bool,), - 'party_role_array': - ([str, none_type],), - 'case_title': - (str, none_type,), - 'case_office': - (int,), - 'case_sequence_number': - (int,), - 'case_year': - (int,), - 'case_type_array': - ([str, none_type],), - 'court_region_id_array': - ([str, none_type],), - 'case_year_from': - (int,), - 'case_year_to': - (int,), - 'case_filed_start_date': - (datetime, none_type,), - 'case_filed_end_date': - (datetime, none_type,), - 'case_terminated_start_date': - (datetime, none_type,), - 'case_terminated_end_date': - (datetime, none_type,), - 'sort_parameter_query': - (str, none_type,), - 'case_status': - (str, none_type,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - 'pacer_client_code': 'pacerClientCode', - 'case_number': 'caseNumber', - 'pacer_case_id': 'pacerCaseId', - 'last_name': 'lastName', - 'first_name': 'firstName', - 'middle_name': 'middleName', - 'generation': 'generation', - 'party_type': 'partyType', - 'party_exact_name_match': 'partyExactNameMatch', - 'party_role_array': 'partyRoleArray', - 'case_title': 'caseTitle', - 'case_office': 'caseOffice', - 'case_sequence_number': 'caseSequenceNumber', - 'case_year': 'caseYear', - 'case_type_array': 'caseTypeArray', - 'court_region_id_array': 'courtRegionIdArray', - 'case_year_from': 'caseYearFrom', - 'case_year_to': 'caseYearTo', - 'case_filed_start_date': 'caseFiledStartDate', - 'case_filed_end_date': 'caseFiledEndDate', - 'case_terminated_start_date': 'caseTerminatedStartDate', - 'case_terminated_end_date': 'caseTerminatedEndDate', - 'sort_parameter_query': 'sortParameterQuery', - 'case_status': 'caseStatus', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'pacer_user_id': 'query', - 'pacer_client_code': 'query', - 'case_number': 'query', - 'pacer_case_id': 'query', - 'last_name': 'query', - 'first_name': 'query', - 'middle_name': 'query', - 'generation': 'query', - 'party_type': 'query', - 'party_exact_name_match': 'query', - 'party_role_array': 'query', - 'case_title': 'query', - 'case_office': 'query', - 'case_sequence_number': 'query', - 'case_year': 'query', - 'case_type_array': 'query', - 'court_region_id_array': 'query', - 'case_year_from': 'query', - 'case_year_to': 'query', - 'case_filed_start_date': 'query', - 'case_filed_end_date': 'query', - 'case_terminated_start_date': 'query', - 'case_terminated_end_date': 'query', - 'sort_parameter_query': 'query', - 'case_status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - 'party_role_array': 'multi', - 'case_type_array': 'multi', - 'court_region_id_array': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - self.import_pacer_case_by_court_using_case_number_endpoint = _Endpoint( - settings={ - 'response_type': (PACERImportCase,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacer/importCaseByCourtUsingCaseNumber', - 'operation_id': 'import_pacer_case_by_court_using_case_number', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'court_id', - ], - 'required': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'court_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'court_id', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 20, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 1, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('court_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - 'pacer_client_code': - (str,), - 'case_number': - (str,), - 'court_id': - (str,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - 'pacer_client_code': 'pacerClientCode', - 'case_number': 'caseNumber', - 'court_id': 'courtId', - }, - 'location_map': { - 'pacer_user_id': 'query', - 'pacer_client_code': 'query', - 'case_number': 'query', - 'court_id': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - self.multi_district_courts_pacer_case_locator_case_search_endpoint = _Endpoint( - settings={ - 'response_type': (PCLCase,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCaseLocator/caseSearch/multiDistrictCourts', - 'operation_id': 'multi_district_courts_pacer_case_locator_case_search', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'jpml_number', - 'pacer_case_id', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_type_array', - 'court_region_id_array', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - 'page_number', - ], - 'required': [ - 'pacer_user_id', - 'pacer_client_code', - ], - 'nullable': [ - 'case_number', - 'case_title', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ], - 'enum': [ - 'case_status', - ], - 'validation': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 20, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 1, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('case_title',): { - 'max_length': 255, - }, - ('case_office',): { - - }, - ('case_sequence_number',): { - - }, - ('case_year',): { - - }, - ('case_filed_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_filed_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('sort_parameter_query',): { - 'max_length': 100, - 'min_length': 5, - }, - ('case_status',): { - 'max_length': 100, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('case_status',): { - 'None': None, - "OPEN": "open", - "CLOSED": "closed" - }, - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - 'pacer_client_code': - (str,), - 'case_number': - (str, none_type,), - 'jpml_number': - (int,), - 'pacer_case_id': - (int,), - 'case_title': - (str, none_type,), - 'case_office': - (int,), - 'case_sequence_number': - (int,), - 'case_year': - (int,), - 'case_type_array': - ([str, none_type],), - 'court_region_id_array': - ([str, none_type],), - 'case_filed_start_date': - (datetime, none_type,), - 'case_filed_end_date': - (datetime, none_type,), - 'case_terminated_start_date': - (datetime, none_type,), - 'case_terminated_end_date': - (datetime, none_type,), - 'sort_parameter_query': - (str, none_type,), - 'case_status': - (str, none_type,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - 'pacer_client_code': 'pacerClientCode', - 'case_number': 'caseNumber', - 'jpml_number': 'jpmlNumber', - 'pacer_case_id': 'pacerCaseId', - 'case_title': 'caseTitle', - 'case_office': 'caseOffice', - 'case_sequence_number': 'caseSequenceNumber', - 'case_year': 'caseYear', - 'case_type_array': 'caseTypeArray', - 'court_region_id_array': 'courtRegionIdArray', - 'case_filed_start_date': 'caseFiledStartDate', - 'case_filed_end_date': 'caseFiledEndDate', - 'case_terminated_start_date': 'caseTerminatedStartDate', - 'case_terminated_end_date': 'caseTerminatedEndDate', - 'sort_parameter_query': 'sortParameterQuery', - 'case_status': 'caseStatus', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'pacer_user_id': 'query', - 'pacer_client_code': 'query', - 'case_number': 'query', - 'jpml_number': 'query', - 'pacer_case_id': 'query', - 'case_title': 'query', - 'case_office': 'query', - 'case_sequence_number': 'query', - 'case_year': 'query', - 'case_type_array': 'query', - 'court_region_id_array': 'query', - 'case_filed_start_date': 'query', - 'case_filed_end_date': 'query', - 'case_terminated_start_date': 'query', - 'case_terminated_end_date': 'query', - 'sort_parameter_query': 'query', - 'case_status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - 'case_type_array': 'multi', - 'court_region_id_array': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + + @validate_call + def all_courts_pacer_case_locator_case_search_without_preload_content( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PACER Case Locator Search API for All Courts. + + Search all courts within the PACER system for a particular case. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._all_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.multi_district_courts_pacer_case_locator_party_search_endpoint = _Endpoint( - settings={ - 'response_type': (PCLParty,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCaseLocator/partySearch/multiDistrictCourts', - 'operation_id': 'multi_district_courts_pacer_case_locator_party_search', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'jpml_number', - 'pacer_case_id', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'party_exact_name_match', - 'party_role_array', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_type_array', - 'court_region_id_array', - 'case_year_from', - 'case_year_to', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - 'page_number', - ], - 'required': [ - 'pacer_user_id', - 'pacer_client_code', - ], - 'nullable': [ - 'case_number', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'case_title', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ], - 'enum': [ - 'case_status', - ], - 'validation': [ - 'pacer_user_id', - 'pacer_client_code', - 'case_number', - 'last_name', - 'first_name', - 'middle_name', - 'generation', - 'party_type', - 'case_title', - 'case_office', - 'case_sequence_number', - 'case_year', - 'case_year_from', - 'case_year_to', - 'case_filed_start_date', - 'case_filed_end_date', - 'case_terminated_start_date', - 'case_terminated_end_date', - 'sort_parameter_query', - 'case_status', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 20, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 1, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('last_name',): { - 'max_length': 50, - }, - ('first_name',): { - 'max_length': 100, - }, - ('middle_name',): { - 'max_length': 100, - }, - ('generation',): { - 'max_length': 5, - }, - ('party_type',): { - 'max_length': 50, - }, - ('case_title',): { - 'max_length': 255, - }, - ('case_office',): { - - }, - ('case_sequence_number',): { - - }, - ('case_year',): { - - }, - ('case_year_from',): { - - }, - ('case_year_to',): { - - }, - ('case_filed_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_filed_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_terminated_end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('sort_parameter_query',): { - 'max_length': 100, - 'min_length': 5, - }, - ('case_status',): { - 'max_length': 100, - 'min_length': 3, - }, - }, - 'allowed_values': { - ('case_status',): { - 'None': None, - "OPEN": "open", - "CLOSED": "closed" - }, - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - 'pacer_client_code': - (str,), - 'case_number': - (str, none_type,), - 'jpml_number': - (int,), - 'pacer_case_id': - (int,), - 'last_name': - (str, none_type,), - 'first_name': - (str, none_type,), - 'middle_name': - (str, none_type,), - 'generation': - (str, none_type,), - 'party_type': - (str, none_type,), - 'party_exact_name_match': - (bool,), - 'party_role_array': - ([str, none_type],), - 'case_title': - (str, none_type,), - 'case_office': - (int,), - 'case_sequence_number': - (int,), - 'case_year': - (int,), - 'case_type_array': - ([str, none_type],), - 'court_region_id_array': - ([str, none_type],), - 'case_year_from': - (int,), - 'case_year_to': - (int,), - 'case_filed_start_date': - (datetime, none_type,), - 'case_filed_end_date': - (datetime, none_type,), - 'case_terminated_start_date': - (datetime, none_type,), - 'case_terminated_end_date': - (datetime, none_type,), - 'sort_parameter_query': - (str, none_type,), - 'case_status': - (str, none_type,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - 'pacer_client_code': 'pacerClientCode', - 'case_number': 'caseNumber', - 'jpml_number': 'jpmlNumber', - 'pacer_case_id': 'pacerCaseId', - 'last_name': 'lastName', - 'first_name': 'firstName', - 'middle_name': 'middleName', - 'generation': 'generation', - 'party_type': 'partyType', - 'party_exact_name_match': 'partyExactNameMatch', - 'party_role_array': 'partyRoleArray', - 'case_title': 'caseTitle', - 'case_office': 'caseOffice', - 'case_sequence_number': 'caseSequenceNumber', - 'case_year': 'caseYear', - 'case_type_array': 'caseTypeArray', - 'court_region_id_array': 'courtRegionIdArray', - 'case_year_from': 'caseYearFrom', - 'case_year_to': 'caseYearTo', - 'case_filed_start_date': 'caseFiledStartDate', - 'case_filed_end_date': 'caseFiledEndDate', - 'case_terminated_start_date': 'caseTerminatedStartDate', - 'case_terminated_end_date': 'caseTerminatedEndDate', - 'sort_parameter_query': 'sortParameterQuery', - 'case_status': 'caseStatus', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'pacer_user_id': 'query', - 'pacer_client_code': 'query', - 'case_number': 'query', - 'jpml_number': 'query', - 'pacer_case_id': 'query', - 'last_name': 'query', - 'first_name': 'query', - 'middle_name': 'query', - 'generation': 'query', - 'party_type': 'query', - 'party_exact_name_match': 'query', - 'party_role_array': 'query', - 'case_title': 'query', - 'case_office': 'query', - 'case_sequence_number': 'query', - 'case_year': 'query', - 'case_type_array': 'query', - 'court_region_id_array': 'query', - 'case_year_from': 'query', - 'case_year_to': 'query', - 'case_filed_start_date': 'query', - 'case_filed_end_date': 'query', - 'case_terminated_start_date': 'query', - 'case_terminated_end_date': 'query', - 'sort_parameter_query': 'query', - 'case_status': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - 'party_role_array': 'multi', - 'case_type_array': 'multi', - 'court_region_id_array': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - def all_courts_pacer_case_locator_case_search( + + def _all_courts_pacer_case_locator_case_search_serialize( self, pacer_user_id, pacer_client_code, - **kwargs - ): - """PACER Case Locator Search API for All Courts. # noqa: E501 - - Search all courts within the PACER system for a particular case. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.all_courts_pacer_case_locator_case_search(pacer_user_id, pacer_client_code, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The username of the PACER account under which the search is to be performed. - pacer_client_code (str): The PACER client code under which the search is to be performed. - - Keyword Args: - case_number (str, none_type): The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).. [optional] - pacer_case_id (int): The PACER-assigned identifier of the target case.. [optional] - case_title (str, none_type): The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.. [optional] - case_office (int): The divisional office in which the case was filed.. [optional] - case_sequence_number (int): The PACER-assigned sequence number of the target case. Ex 12345. [optional] - case_year (int, none_type): The two- or four-digit year in which the target case was filed.. [optional] - case_type_array ([str, none_type]): The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr. [optional] - court_region_id_array ([str, none_type]): The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae. [optional] - case_filed_start_date (datetime, none_type): The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_filed_end_date (datetime, none_type): The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_start_date (datetime, none_type): The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_end_date (datetime, none_type): The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - sort_parameter_query (str, none_type): How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC. [optional] if omitted the server will use the default value of "caseYear,DESC" - case_status (str, none_type): Whether the target case is marked as 'open' or 'closed' within PACER.. [optional] - page_number (int): The page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PCLCase - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_number, + pacer_case_id, + case_title, + case_office, + case_sequence_number, + case_year, + case_type_array, + court_region_id_array, + case_filed_start_date, + case_filed_end_date, + case_terminated_start_date, + case_terminated_end_date, + sort_parameter_query, + case_status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'caseTypeArray': 'multi', + 'courtRegionIdArray': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pacer_user_id is not None: + + _query_params.append(('pacerUserId', pacer_user_id)) + + if pacer_client_code is not None: + + _query_params.append(('pacerClientCode', pacer_client_code)) + + if case_number is not None: + + _query_params.append(('caseNumber', case_number)) + + if pacer_case_id is not None: + + _query_params.append(('pacerCaseId', pacer_case_id)) + + if case_title is not None: + + _query_params.append(('caseTitle', case_title)) + + if case_office is not None: + + _query_params.append(('caseOffice', case_office)) + + if case_sequence_number is not None: + + _query_params.append(('caseSequenceNumber', case_sequence_number)) + + if case_year is not None: + + _query_params.append(('caseYear', case_year)) + + if case_type_array is not None: + + _query_params.append(('caseTypeArray', case_type_array)) + + if court_region_id_array is not None: + + _query_params.append(('courtRegionIdArray', court_region_id_array)) + + if case_filed_start_date is not None: + if isinstance(case_filed_start_date, datetime): + _query_params.append( + ( + 'caseFiledStartDate', + case_filed_start_date + ) + ) + else: + _query_params.append(('caseFiledStartDate', case_filed_start_date)) + + if case_filed_end_date is not None: + if isinstance(case_filed_end_date, datetime): + _query_params.append( + ( + 'caseFiledEndDate', + case_filed_end_date + ) + ) + else: + _query_params.append(('caseFiledEndDate', case_filed_end_date)) + + if case_terminated_start_date is not None: + if isinstance(case_terminated_start_date, datetime): + _query_params.append( + ( + 'caseTerminatedStartDate', + case_terminated_start_date + ) + ) + else: + _query_params.append(('caseTerminatedStartDate', case_terminated_start_date)) + + if case_terminated_end_date is not None: + if isinstance(case_terminated_end_date, datetime): + _query_params.append( + ( + 'caseTerminatedEndDate', + case_terminated_end_date + ) + ) + else: + _query_params.append(('caseTerminatedEndDate', case_terminated_end_date)) + + if sort_parameter_query is not None: + + _query_params.append(('sortParameterQuery', sort_parameter_query)) + + if case_status is not None: + + _query_params.append(('caseStatus', case_status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacerCaseLocator/caseSearch/allCourts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def all_courts_pacer_case_locator_party_search( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case.")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PCLParty: + """PACER Case Locator Search API for All Courts. + + Search for the specified party across all PACER case filings. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._all_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def all_courts_pacer_case_locator_party_search_with_http_info( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case.")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLParty]: + """PACER Case Locator Search API for All Courts. + + Search for the specified party across all PACER case filings. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._all_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - kwargs['pacer_client_code'] = \ - pacer_client_code - return self.all_courts_pacer_case_locator_case_search_endpoint.call_with_http_info(**kwargs) - def all_courts_pacer_case_locator_party_search( + + @validate_call + def all_courts_pacer_case_locator_party_search_without_preload_content( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case.")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PACER Case Locator Search API for All Courts. + + Search for the specified party across all PACER case filings. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._all_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _all_courts_pacer_case_locator_party_search_serialize( self, pacer_user_id, pacer_client_code, - **kwargs - ): - """PACER Case Locator Search API for All Courts. # noqa: E501 - - Search for the specified party across all PACER case filings. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.all_courts_pacer_case_locator_party_search(pacer_user_id, pacer_client_code, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The username of the PACER account under which the search is to be performed. - pacer_client_code (str): The PACER client code under which the search is to be performed. - - Keyword Args: - case_number (str, none_type): The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).. [optional] - pacer_case_id (int): The PACER-assigned identifier of the target case.. [optional] - last_name (str, none_type): The last name (for an individual) or the entity name (for a business entity) of the target party.. [optional] - first_name (str, none_type): The first name of the target party.. [optional] - middle_name (str, none_type): The middle name of the target party.. [optional] - generation (str, none_type): The suffix (e.g., Jr., III) of the target party's name.. [optional] - party_type (str, none_type): The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.. [optional] - party_exact_name_match (bool): Specify whether the search string must match the name of the target party exactly.. [optional] - party_role_array ([str, none_type]): The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.. [optional] - case_title (str, none_type): The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.. [optional] - case_office (int): The divisional office in which the case was filed.. [optional] - case_sequence_number (int): The PACER-assigned sequence number of the target case.. [optional] - case_year (int): The two- or four-digit year in which the target case was filed.. [optional] - case_type_array ([str, none_type]): The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr. [optional] - court_region_id_array ([str, none_type]): The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae. [optional] - case_year_from (int): Limit the results of the search to those cases from the year specified or later. [optional] - case_year_to (int): Limit the results of the search to those cases from the year specified or earlier. [optional] - case_filed_start_date (datetime, none_type): The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_filed_end_date (datetime, none_type): The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_start_date (datetime, none_type): The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_end_date (datetime, none_type): The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - sort_parameter_query (str, none_type): How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC. [optional] if omitted the server will use the default value of "lastName,ASC" - case_status (str, none_type): Whether the target case is marked as 'open' or 'closed' within PACER.. [optional] - page_number (int): The page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PCLParty - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_number, + pacer_case_id, + last_name, + first_name, + middle_name, + generation, + party_type, + party_exact_name_match, + party_role_array, + case_title, + case_office, + case_sequence_number, + case_year, + case_type_array, + court_region_id_array, + case_year_from, + case_year_to, + case_filed_start_date, + case_filed_end_date, + case_terminated_start_date, + case_terminated_end_date, + sort_parameter_query, + case_status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'partyRoleArray': 'multi', + 'caseTypeArray': 'multi', + 'courtRegionIdArray': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pacer_user_id is not None: + + _query_params.append(('pacerUserId', pacer_user_id)) + + if pacer_client_code is not None: + + _query_params.append(('pacerClientCode', pacer_client_code)) + + if case_number is not None: + + _query_params.append(('caseNumber', case_number)) + + if pacer_case_id is not None: + + _query_params.append(('pacerCaseId', pacer_case_id)) + + if last_name is not None: + + _query_params.append(('lastName', last_name)) + + if first_name is not None: + + _query_params.append(('firstName', first_name)) + + if middle_name is not None: + + _query_params.append(('middleName', middle_name)) + + if generation is not None: + + _query_params.append(('generation', generation)) + + if party_type is not None: + + _query_params.append(('partyType', party_type)) + + if party_exact_name_match is not None: + + _query_params.append(('partyExactNameMatch', party_exact_name_match)) + + if party_role_array is not None: + + _query_params.append(('partyRoleArray', party_role_array)) + + if case_title is not None: + + _query_params.append(('caseTitle', case_title)) + + if case_office is not None: + + _query_params.append(('caseOffice', case_office)) + + if case_sequence_number is not None: + + _query_params.append(('caseSequenceNumber', case_sequence_number)) + + if case_year is not None: + + _query_params.append(('caseYear', case_year)) + + if case_type_array is not None: + + _query_params.append(('caseTypeArray', case_type_array)) + + if court_region_id_array is not None: + + _query_params.append(('courtRegionIdArray', court_region_id_array)) + + if case_year_from is not None: + + _query_params.append(('caseYearFrom', case_year_from)) + + if case_year_to is not None: + + _query_params.append(('caseYearTo', case_year_to)) + + if case_filed_start_date is not None: + if isinstance(case_filed_start_date, datetime): + _query_params.append( + ( + 'caseFiledStartDate', + case_filed_start_date + ) + ) + else: + _query_params.append(('caseFiledStartDate', case_filed_start_date)) + + if case_filed_end_date is not None: + if isinstance(case_filed_end_date, datetime): + _query_params.append( + ( + 'caseFiledEndDate', + case_filed_end_date + ) + ) + else: + _query_params.append(('caseFiledEndDate', case_filed_end_date)) + + if case_terminated_start_date is not None: + if isinstance(case_terminated_start_date, datetime): + _query_params.append( + ( + 'caseTerminatedStartDate', + case_terminated_start_date + ) + ) + else: + _query_params.append(('caseTerminatedStartDate', case_terminated_start_date)) + + if case_terminated_end_date is not None: + if isinstance(case_terminated_end_date, datetime): + _query_params.append( + ( + 'caseTerminatedEndDate', + case_terminated_end_date + ) + ) + else: + _query_params.append(('caseTerminatedEndDate', case_terminated_end_date)) + + if sort_parameter_query is not None: + + _query_params.append(('sortParameterQuery', sort_parameter_query)) + + if case_status is not None: + + _query_params.append(('caseStatus', case_status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacerCaseLocator/partySearch/allCourts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def appeal_courts_pacer_case_locator_case_search( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + nature_of_suits_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases in U.S. Courts of Appeals. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 1110 (Insurance) and 1150 (Overpayments & Enforc. of Judgments), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=1110&natureOfSuitsArray=1150")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PCLCase: + """PACER Case Locator Search API for All Courts. + + Search for PACER cases filed in U.S. Courts of Appeals. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param nature_of_suits_array: The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases in U.S. Courts of Appeals. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 1110 (Insurance) and 1150 (Overpayments & Enforc. of Judgments), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=1110&natureOfSuitsArray=1150 + :type nature_of_suits_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._appeal_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + nature_of_suits_array=nature_of_suits_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def appeal_courts_pacer_case_locator_case_search_with_http_info( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + nature_of_suits_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases in U.S. Courts of Appeals. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 1110 (Insurance) and 1150 (Overpayments & Enforc. of Judgments), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=1110&natureOfSuitsArray=1150")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLCase]: + """PACER Case Locator Search API for All Courts. + + Search for PACER cases filed in U.S. Courts of Appeals. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param nature_of_suits_array: The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases in U.S. Courts of Appeals. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 1110 (Insurance) and 1150 (Overpayments & Enforc. of Judgments), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=1110&natureOfSuitsArray=1150 + :type nature_of_suits_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._appeal_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + nature_of_suits_array=nature_of_suits_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - kwargs['pacer_client_code'] = \ - pacer_client_code - return self.all_courts_pacer_case_locator_party_search_endpoint.call_with_http_info(**kwargs) - def appeal_courts_pacer_case_locator_case_search( + + @validate_call + def appeal_courts_pacer_case_locator_case_search_without_preload_content( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + nature_of_suits_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases in U.S. Courts of Appeals. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 1110 (Insurance) and 1150 (Overpayments & Enforc. of Judgments), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=1110&natureOfSuitsArray=1150")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PACER Case Locator Search API for All Courts. + + Search for PACER cases filed in U.S. Courts of Appeals. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param nature_of_suits_array: The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases in U.S. Courts of Appeals. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 1110 (Insurance) and 1150 (Overpayments & Enforc. of Judgments), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=1110&natureOfSuitsArray=1150 + :type nature_of_suits_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._appeal_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + nature_of_suits_array=nature_of_suits_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _appeal_courts_pacer_case_locator_case_search_serialize( self, pacer_user_id, pacer_client_code, - **kwargs - ): - """PACER Case Locator Search API for All Courts. # noqa: E501 - - Search for PACER cases filed in U.S. Courts of Appeals. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.appeal_courts_pacer_case_locator_case_search(pacer_user_id, pacer_client_code, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The username of the PACER account under which the search is to be performed. - pacer_client_code (str): The PACER client code under which the search is to be performed. - - Keyword Args: - case_number (str, none_type): The case number of the target case. You may use the following case-number formats: yy-nnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits).. [optional] - pacer_case_id (int): The PACER-assigned identifier of the target case.. [optional] - case_title (str, none_type): The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.. [optional] - case_office (int, none_type): The divisional office in which the case was filed.. [optional] - case_sequence_number (int): The PACER-assigned sequence number of the target case. Ex 12345. [optional] - case_year (int): The two- or four-digit year in which the target case was filed.. [optional] - case_type_array ([str, none_type]): The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr. [optional] - nature_of_suits_array ([str, none_type]): The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases in U.S. Courts of Appeals. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 1110 (Insurance) and 1150 (Overpayments & Enforc. of Judgments), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=1110&natureOfSuitsArray=1150. [optional] - court_region_id_array ([str, none_type]): The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae. [optional] - case_filed_start_date (datetime, none_type): The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_filed_end_date (datetime, none_type): The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_start_date (datetime, none_type): The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_end_date (datetime, none_type): The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - sort_parameter_query (str, none_type): How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC. [optional] if omitted the server will use the default value of "caseYear,DESC" - case_status (str, none_type): Whether the target case is marked as 'open' or 'closed' within PACER.. [optional] - page_number (int): The page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PCLCase - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_number, + pacer_case_id, + case_title, + case_office, + case_sequence_number, + case_year, + case_type_array, + nature_of_suits_array, + court_region_id_array, + case_filed_start_date, + case_filed_end_date, + case_terminated_start_date, + case_terminated_end_date, + sort_parameter_query, + case_status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'caseTypeArray': 'multi', + 'natureOfSuitsArray': 'multi', + 'courtRegionIdArray': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pacer_user_id is not None: + + _query_params.append(('pacerUserId', pacer_user_id)) + + if pacer_client_code is not None: + + _query_params.append(('pacerClientCode', pacer_client_code)) + + if case_number is not None: + + _query_params.append(('caseNumber', case_number)) + + if pacer_case_id is not None: + + _query_params.append(('pacerCaseId', pacer_case_id)) + + if case_title is not None: + + _query_params.append(('caseTitle', case_title)) + + if case_office is not None: + + _query_params.append(('caseOffice', case_office)) + + if case_sequence_number is not None: + + _query_params.append(('caseSequenceNumber', case_sequence_number)) + + if case_year is not None: + + _query_params.append(('caseYear', case_year)) + + if case_type_array is not None: + + _query_params.append(('caseTypeArray', case_type_array)) + + if nature_of_suits_array is not None: + + _query_params.append(('natureOfSuitsArray', nature_of_suits_array)) + + if court_region_id_array is not None: + + _query_params.append(('courtRegionIdArray', court_region_id_array)) + + if case_filed_start_date is not None: + if isinstance(case_filed_start_date, datetime): + _query_params.append( + ( + 'caseFiledStartDate', + case_filed_start_date + ) + ) + else: + _query_params.append(('caseFiledStartDate', case_filed_start_date)) + + if case_filed_end_date is not None: + if isinstance(case_filed_end_date, datetime): + _query_params.append( + ( + 'caseFiledEndDate', + case_filed_end_date + ) + ) + else: + _query_params.append(('caseFiledEndDate', case_filed_end_date)) + + if case_terminated_start_date is not None: + if isinstance(case_terminated_start_date, datetime): + _query_params.append( + ( + 'caseTerminatedStartDate', + case_terminated_start_date + ) + ) + else: + _query_params.append(('caseTerminatedStartDate', case_terminated_start_date)) + + if case_terminated_end_date is not None: + if isinstance(case_terminated_end_date, datetime): + _query_params.append( + ( + 'caseTerminatedEndDate', + case_terminated_end_date + ) + ) + else: + _query_params.append(('caseTerminatedEndDate', case_terminated_end_date)) + + if sort_parameter_query is not None: + + _query_params.append(('sortParameterQuery', sort_parameter_query)) + + if case_status is not None: + + _query_params.append(('caseStatus', case_status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacerCaseLocator/caseSearch/appealCourts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def appeal_courts_pacer_case_locator_party_search( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PCLParty: + """PACER Case Locator Search API for All Courts. + + Search for the specified party across all PACER appeals cases. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._appeal_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def appeal_courts_pacer_case_locator_party_search_with_http_info( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLParty]: + """PACER Case Locator Search API for All Courts. + + Search for the specified party across all PACER appeals cases. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._appeal_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def appeal_courts_pacer_case_locator_party_search_without_preload_content( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PACER Case Locator Search API for All Courts. + + Search for the specified party across all PACER appeals cases. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._appeal_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - kwargs['pacer_client_code'] = \ - pacer_client_code - return self.appeal_courts_pacer_case_locator_case_search_endpoint.call_with_http_info(**kwargs) + return response_data.response - def appeal_courts_pacer_case_locator_party_search( + + def _appeal_courts_pacer_case_locator_party_search_serialize( self, pacer_user_id, pacer_client_code, - **kwargs - ): - """PACER Case Locator Search API for All Courts. # noqa: E501 - - Search for the specified party across all PACER appeals cases. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.appeal_courts_pacer_case_locator_party_search(pacer_user_id, pacer_client_code, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The username of the PACER account under which the search is to be performed. - pacer_client_code (str): The PACER client code under which the search is to be performed. - - Keyword Args: - case_number (str, none_type): The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).. [optional] - pacer_case_id (int): The PACER-assigned identifier of the target case.. [optional] - last_name (str, none_type): The last name (for an individual) or the entity name (for a business entity) of the target party.. [optional] - first_name (str, none_type): The first name of the target party.. [optional] - middle_name (str, none_type): The middle name of the target party.. [optional] - generation (str, none_type): The suffix (e.g., Jr., III) of the target party's name.. [optional] - party_type (str, none_type): The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.. [optional] - party_exact_name_match (bool): Specify whether the search string must match the name of the target party exactly.. [optional] - party_role_array ([str, none_type]): The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.. [optional] - case_title (str, none_type): The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.. [optional] - case_office (int): The divisional office in which the case was filed.. [optional] - case_sequence_number (int): The PACER-assigned sequence number of the target case. Ex 12345. [optional] - case_year (int): The two- or four-digit year in which the target case was filed.. [optional] - case_type_array ([str, none_type]): The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr. [optional] - court_region_id_array ([str, none_type]): The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae. [optional] - case_year_from (int): Limit the results of the search to those cases from the year specified or later. [optional] - case_year_to (int): Limit the results of the search to those cases from the year specified or earlier. [optional] - case_filed_start_date (datetime, none_type): The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_filed_end_date (datetime, none_type): The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_start_date (datetime, none_type): The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_end_date (datetime, none_type): The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - sort_parameter_query (str, none_type): How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC. [optional] if omitted the server will use the default value of "lastName,ASC" - case_status (str, none_type): Whether the target case is marked as 'open' or 'closed' within PACER.. [optional] - page_number (int): The page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PCLParty - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_number, + pacer_case_id, + last_name, + first_name, + middle_name, + generation, + party_type, + party_exact_name_match, + party_role_array, + case_title, + case_office, + case_sequence_number, + case_year, + case_type_array, + court_region_id_array, + case_year_from, + case_year_to, + case_filed_start_date, + case_filed_end_date, + case_terminated_start_date, + case_terminated_end_date, + sort_parameter_query, + case_status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'partyRoleArray': 'multi', + 'caseTypeArray': 'multi', + 'courtRegionIdArray': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pacer_user_id is not None: + + _query_params.append(('pacerUserId', pacer_user_id)) + + if pacer_client_code is not None: + + _query_params.append(('pacerClientCode', pacer_client_code)) + + if case_number is not None: + + _query_params.append(('caseNumber', case_number)) + + if pacer_case_id is not None: + + _query_params.append(('pacerCaseId', pacer_case_id)) + + if last_name is not None: + + _query_params.append(('lastName', last_name)) + + if first_name is not None: + + _query_params.append(('firstName', first_name)) + + if middle_name is not None: + + _query_params.append(('middleName', middle_name)) + + if generation is not None: + + _query_params.append(('generation', generation)) + + if party_type is not None: + + _query_params.append(('partyType', party_type)) + + if party_exact_name_match is not None: + + _query_params.append(('partyExactNameMatch', party_exact_name_match)) + + if party_role_array is not None: + + _query_params.append(('partyRoleArray', party_role_array)) + + if case_title is not None: + + _query_params.append(('caseTitle', case_title)) + + if case_office is not None: + + _query_params.append(('caseOffice', case_office)) + + if case_sequence_number is not None: + + _query_params.append(('caseSequenceNumber', case_sequence_number)) + + if case_year is not None: + + _query_params.append(('caseYear', case_year)) + + if case_type_array is not None: + + _query_params.append(('caseTypeArray', case_type_array)) + + if court_region_id_array is not None: + + _query_params.append(('courtRegionIdArray', court_region_id_array)) + + if case_year_from is not None: + + _query_params.append(('caseYearFrom', case_year_from)) + + if case_year_to is not None: + + _query_params.append(('caseYearTo', case_year_to)) + + if case_filed_start_date is not None: + if isinstance(case_filed_start_date, datetime): + _query_params.append( + ( + 'caseFiledStartDate', + case_filed_start_date + ) + ) + else: + _query_params.append(('caseFiledStartDate', case_filed_start_date)) + + if case_filed_end_date is not None: + if isinstance(case_filed_end_date, datetime): + _query_params.append( + ( + 'caseFiledEndDate', + case_filed_end_date + ) + ) + else: + _query_params.append(('caseFiledEndDate', case_filed_end_date)) + + if case_terminated_start_date is not None: + if isinstance(case_terminated_start_date, datetime): + _query_params.append( + ( + 'caseTerminatedStartDate', + case_terminated_start_date + ) + ) + else: + _query_params.append(('caseTerminatedStartDate', case_terminated_start_date)) + + if case_terminated_end_date is not None: + if isinstance(case_terminated_end_date, datetime): + _query_params.append( + ( + 'caseTerminatedEndDate', + case_terminated_end_date + ) + ) + else: + _query_params.append(('caseTerminatedEndDate', case_terminated_end_date)) + + if sort_parameter_query is not None: + + _query_params.append(('sortParameterQuery', sort_parameter_query)) + + if case_status is not None: + + _query_params.append(('caseStatus', case_status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacerCaseLocator/partySearch/appealCourts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def bankruptcy_courts_pacer_case_locator_case_search( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + federal_bankruptcy_chapter_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The chapter of the U.S. Bankruptcy Code under which the target case was filed. Please refer PCL Bankruptcy Chapters for a list of valid chapter numbers. Scenario: When mulitple Federal Bankruptcy Chapters needs to be requested. Imagine for a given case number 12-1234 I would like to search with the Federal Bankruptcy Chapters 7 (Chapter 7) and 11 (Chapter 11), My query in the request will look like the example mentioned below. Example: federalBankruptcyChapterArray=7&federalBankruptcyChapterArray=11")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_discharged_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_discharged_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PCLCase: + """PACER Case Locator Search API for Bankruptcy Courts. + + Search for PACER cases filed in U.S. Bankruptcy Courts. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param federal_bankruptcy_chapter_array: The chapter of the U.S. Bankruptcy Code under which the target case was filed. Please refer PCL Bankruptcy Chapters for a list of valid chapter numbers. Scenario: When mulitple Federal Bankruptcy Chapters needs to be requested. Imagine for a given case number 12-1234 I would like to search with the Federal Bankruptcy Chapters 7 (Chapter 7) and 11 (Chapter 11), My query in the request will look like the example mentioned below. Example: federalBankruptcyChapterArray=7&federalBankruptcyChapterArray=11 + :type federal_bankruptcy_chapter_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param case_discharged_start_date: The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_start_date: datetime + :param case_discharged_end_date: The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_end_date: datetime + :param case_dismissed_start_date: The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_dismissed_start_date: datetime + :param case_dismissed_end_date: The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_dismissed_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bankruptcy_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + federal_bankruptcy_chapter_array=federal_bankruptcy_chapter_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + case_discharged_start_date=case_discharged_start_date, + case_discharged_end_date=case_discharged_end_date, + case_dismissed_start_date=case_dismissed_start_date, + case_dismissed_end_date=case_dismissed_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def bankruptcy_courts_pacer_case_locator_case_search_with_http_info( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + federal_bankruptcy_chapter_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The chapter of the U.S. Bankruptcy Code under which the target case was filed. Please refer PCL Bankruptcy Chapters for a list of valid chapter numbers. Scenario: When mulitple Federal Bankruptcy Chapters needs to be requested. Imagine for a given case number 12-1234 I would like to search with the Federal Bankruptcy Chapters 7 (Chapter 7) and 11 (Chapter 11), My query in the request will look like the example mentioned below. Example: federalBankruptcyChapterArray=7&federalBankruptcyChapterArray=11")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_discharged_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_discharged_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLCase]: + """PACER Case Locator Search API for Bankruptcy Courts. + + Search for PACER cases filed in U.S. Bankruptcy Courts. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param federal_bankruptcy_chapter_array: The chapter of the U.S. Bankruptcy Code under which the target case was filed. Please refer PCL Bankruptcy Chapters for a list of valid chapter numbers. Scenario: When mulitple Federal Bankruptcy Chapters needs to be requested. Imagine for a given case number 12-1234 I would like to search with the Federal Bankruptcy Chapters 7 (Chapter 7) and 11 (Chapter 11), My query in the request will look like the example mentioned below. Example: federalBankruptcyChapterArray=7&federalBankruptcyChapterArray=11 + :type federal_bankruptcy_chapter_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param case_discharged_start_date: The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_start_date: datetime + :param case_discharged_end_date: The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_end_date: datetime + :param case_dismissed_start_date: The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_dismissed_start_date: datetime + :param case_dismissed_end_date: The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_dismissed_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bankruptcy_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + federal_bankruptcy_chapter_array=federal_bankruptcy_chapter_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + case_discharged_start_date=case_discharged_start_date, + case_discharged_end_date=case_discharged_end_date, + case_dismissed_start_date=case_dismissed_start_date, + case_dismissed_end_date=case_dismissed_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - kwargs['pacer_client_code'] = \ - pacer_client_code - return self.appeal_courts_pacer_case_locator_party_search_endpoint.call_with_http_info(**kwargs) - def bankruptcy_courts_pacer_case_locator_case_search( + + @validate_call + def bankruptcy_courts_pacer_case_locator_case_search_without_preload_content( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + federal_bankruptcy_chapter_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The chapter of the U.S. Bankruptcy Code under which the target case was filed. Please refer PCL Bankruptcy Chapters for a list of valid chapter numbers. Scenario: When mulitple Federal Bankruptcy Chapters needs to be requested. Imagine for a given case number 12-1234 I would like to search with the Federal Bankruptcy Chapters 7 (Chapter 7) and 11 (Chapter 11), My query in the request will look like the example mentioned below. Example: federalBankruptcyChapterArray=7&federalBankruptcyChapterArray=11")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_discharged_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_discharged_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PACER Case Locator Search API for Bankruptcy Courts. + + Search for PACER cases filed in U.S. Bankruptcy Courts. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param federal_bankruptcy_chapter_array: The chapter of the U.S. Bankruptcy Code under which the target case was filed. Please refer PCL Bankruptcy Chapters for a list of valid chapter numbers. Scenario: When mulitple Federal Bankruptcy Chapters needs to be requested. Imagine for a given case number 12-1234 I would like to search with the Federal Bankruptcy Chapters 7 (Chapter 7) and 11 (Chapter 11), My query in the request will look like the example mentioned below. Example: federalBankruptcyChapterArray=7&federalBankruptcyChapterArray=11 + :type federal_bankruptcy_chapter_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param case_discharged_start_date: The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_start_date: datetime + :param case_discharged_end_date: The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_end_date: datetime + :param case_dismissed_start_date: The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_dismissed_start_date: datetime + :param case_dismissed_end_date: The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_dismissed_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bankruptcy_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + federal_bankruptcy_chapter_array=federal_bankruptcy_chapter_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + case_discharged_start_date=case_discharged_start_date, + case_discharged_end_date=case_discharged_end_date, + case_dismissed_start_date=case_dismissed_start_date, + case_dismissed_end_date=case_dismissed_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _bankruptcy_courts_pacer_case_locator_case_search_serialize( self, pacer_user_id, pacer_client_code, - **kwargs - ): - """PACER Case Locator Search API for Bankruptcy Courts. # noqa: E501 - - Search for PACER cases filed in U.S. Bankruptcy Courts. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.bankruptcy_courts_pacer_case_locator_case_search(pacer_user_id, pacer_client_code, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The username of the PACER account under which the search is to be performed. - pacer_client_code (str): The PACER client code under which the search is to be performed. - - Keyword Args: - case_number (str, none_type): The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).. [optional] - pacer_case_id (int): The PACER-assigned identifier of the target case.. [optional] - case_title (str, none_type): The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.. [optional] - case_office (int): The divisional office in which the case was filed.. [optional] - case_sequence_number (int): The PACER-assigned sequence number of the target case. Ex 12345. [optional] - case_year (int): The two- or four-digit year in which the target case was filed.. [optional] - case_type_array ([str, none_type]): The PACER-assigned case type of the target case. Please refer PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr. [optional] - federal_bankruptcy_chapter_array ([str, none_type]): The chapter of the U.S. Bankruptcy Code under which the target case was filed. Please refer PCL Bankruptcy Chapters for a list of valid chapter numbers. Scenario: When mulitple Federal Bankruptcy Chapters needs to be requested. Imagine for a given case number 12-1234 I would like to search with the Federal Bankruptcy Chapters 7 (Chapter 7) and 11 (Chapter 11), My query in the request will look like the example mentioned below. Example: federalBankruptcyChapterArray=7&federalBankruptcyChapterArray=11. [optional] - court_region_id_array ([str, none_type]): The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae. [optional] - case_filed_start_date (datetime, none_type): The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_filed_end_date (datetime, none_type): The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_start_date (datetime, none_type): The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_end_date (datetime, none_type): The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_discharged_start_date (datetime, none_type): The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.. [optional] - case_discharged_end_date (datetime, none_type): The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.. [optional] - case_dismissed_start_date (datetime, none_type): The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.. [optional] - case_dismissed_end_date (datetime, none_type): The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - sort_parameter_query (str, none_type): How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC. [optional] if omitted the server will use the default value of "caseYear,DESC" - case_status (str, none_type): Whether the target case is marked as 'open' or 'closed' within PACER.. [optional] - page_number (int): The page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PCLCase - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_number, + pacer_case_id, + case_title, + case_office, + case_sequence_number, + case_year, + case_type_array, + federal_bankruptcy_chapter_array, + court_region_id_array, + case_filed_start_date, + case_filed_end_date, + case_terminated_start_date, + case_terminated_end_date, + case_discharged_start_date, + case_discharged_end_date, + case_dismissed_start_date, + case_dismissed_end_date, + sort_parameter_query, + case_status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'caseTypeArray': 'multi', + 'federalBankruptcyChapterArray': 'multi', + 'courtRegionIdArray': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pacer_user_id is not None: + + _query_params.append(('pacerUserId', pacer_user_id)) + + if pacer_client_code is not None: + + _query_params.append(('pacerClientCode', pacer_client_code)) + + if case_number is not None: + + _query_params.append(('caseNumber', case_number)) + + if pacer_case_id is not None: + + _query_params.append(('pacerCaseId', pacer_case_id)) + + if case_title is not None: + + _query_params.append(('caseTitle', case_title)) + + if case_office is not None: + + _query_params.append(('caseOffice', case_office)) + + if case_sequence_number is not None: + + _query_params.append(('caseSequenceNumber', case_sequence_number)) + + if case_year is not None: + + _query_params.append(('caseYear', case_year)) + + if case_type_array is not None: + + _query_params.append(('caseTypeArray', case_type_array)) + + if federal_bankruptcy_chapter_array is not None: + + _query_params.append(('federalBankruptcyChapterArray', federal_bankruptcy_chapter_array)) + + if court_region_id_array is not None: + + _query_params.append(('courtRegionIdArray', court_region_id_array)) + + if case_filed_start_date is not None: + if isinstance(case_filed_start_date, datetime): + _query_params.append( + ( + 'caseFiledStartDate', + case_filed_start_date + ) + ) + else: + _query_params.append(('caseFiledStartDate', case_filed_start_date)) + + if case_filed_end_date is not None: + if isinstance(case_filed_end_date, datetime): + _query_params.append( + ( + 'caseFiledEndDate', + case_filed_end_date + ) + ) + else: + _query_params.append(('caseFiledEndDate', case_filed_end_date)) + + if case_terminated_start_date is not None: + if isinstance(case_terminated_start_date, datetime): + _query_params.append( + ( + 'caseTerminatedStartDate', + case_terminated_start_date + ) + ) + else: + _query_params.append(('caseTerminatedStartDate', case_terminated_start_date)) + + if case_terminated_end_date is not None: + if isinstance(case_terminated_end_date, datetime): + _query_params.append( + ( + 'caseTerminatedEndDate', + case_terminated_end_date + ) + ) + else: + _query_params.append(('caseTerminatedEndDate', case_terminated_end_date)) + + if case_discharged_start_date is not None: + if isinstance(case_discharged_start_date, datetime): + _query_params.append( + ( + 'caseDischargedStartDate', + case_discharged_start_date + ) + ) + else: + _query_params.append(('caseDischargedStartDate', case_discharged_start_date)) + + if case_discharged_end_date is not None: + if isinstance(case_discharged_end_date, datetime): + _query_params.append( + ( + 'caseDischargedEndDate', + case_discharged_end_date + ) + ) + else: + _query_params.append(('caseDischargedEndDate', case_discharged_end_date)) + + if case_dismissed_start_date is not None: + if isinstance(case_dismissed_start_date, datetime): + _query_params.append( + ( + 'caseDismissedStartDate', + case_dismissed_start_date + ) + ) + else: + _query_params.append(('caseDismissedStartDate', case_dismissed_start_date)) + + if case_dismissed_end_date is not None: + if isinstance(case_dismissed_end_date, datetime): + _query_params.append( + ( + 'caseDismissedEndDate', + case_dismissed_end_date + ) + ) + else: + _query_params.append(('caseDismissedEndDate', case_dismissed_end_date)) + + if sort_parameter_query is not None: + + _query_params.append(('sortParameterQuery', sort_parameter_query)) + + if case_status is not None: + + _query_params.append(('caseStatus', case_status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacerCaseLocator/caseSearch/bankruptcyCourts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def bankruptcy_courts_pacer_case_locator_party_search( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + ssn_or_ein: Annotated[Optional[Annotated[str, Field(strict=True, max_length=9)]], Field(description="The Social Security number or the federal Employer Identification Number of the target party. Either number can be entered with or without dashes.")] = None, + four_digit_ssn: Annotated[Optional[Annotated[str, Field(strict=True, max_length=4)]], Field(description="The last four digits of the Social Security number of the target party. Note: When specified, a last name/entity name must also be specified.")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_discharged_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_discharged_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PCLParty: + """PACER Case Locator Search API for All Courts. + + Search for the specified party in PACER bankruptcy filings. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param ssn_or_ein: The Social Security number or the federal Employer Identification Number of the target party. Either number can be entered with or without dashes. + :type ssn_or_ein: str + :param four_digit_ssn: The last four digits of the Social Security number of the target party. Note: When specified, a last name/entity name must also be specified. + :type four_digit_ssn: str + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param case_discharged_start_date: The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_start_date: datetime + :param case_discharged_end_date: The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_end_date: datetime + :param case_dismissed_start_date: The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_dismissed_start_date: datetime + :param case_dismissed_end_date: The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_dismissed_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bankruptcy_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + ssn_or_ein=ssn_or_ein, + four_digit_ssn=four_digit_ssn, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + case_discharged_start_date=case_discharged_start_date, + case_discharged_end_date=case_discharged_end_date, + case_dismissed_start_date=case_dismissed_start_date, + case_dismissed_end_date=case_dismissed_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def bankruptcy_courts_pacer_case_locator_party_search_with_http_info( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + ssn_or_ein: Annotated[Optional[Annotated[str, Field(strict=True, max_length=9)]], Field(description="The Social Security number or the federal Employer Identification Number of the target party. Either number can be entered with or without dashes.")] = None, + four_digit_ssn: Annotated[Optional[Annotated[str, Field(strict=True, max_length=4)]], Field(description="The last four digits of the Social Security number of the target party. Note: When specified, a last name/entity name must also be specified.")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_discharged_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_discharged_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLParty]: + """PACER Case Locator Search API for All Courts. + + Search for the specified party in PACER bankruptcy filings. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param ssn_or_ein: The Social Security number or the federal Employer Identification Number of the target party. Either number can be entered with or without dashes. + :type ssn_or_ein: str + :param four_digit_ssn: The last four digits of the Social Security number of the target party. Note: When specified, a last name/entity name must also be specified. + :type four_digit_ssn: str + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param case_discharged_start_date: The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_start_date: datetime + :param case_discharged_end_date: The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_end_date: datetime + :param case_dismissed_start_date: The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_dismissed_start_date: datetime + :param case_dismissed_end_date: The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_dismissed_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bankruptcy_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + ssn_or_ein=ssn_or_ein, + four_digit_ssn=four_digit_ssn, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + case_discharged_start_date=case_discharged_start_date, + case_discharged_end_date=case_discharged_end_date, + case_dismissed_start_date=case_dismissed_start_date, + case_dismissed_end_date=case_dismissed_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - kwargs['pacer_client_code'] = \ - pacer_client_code - return self.bankruptcy_courts_pacer_case_locator_case_search_endpoint.call_with_http_info(**kwargs) - def bankruptcy_courts_pacer_case_locator_party_search( + + @validate_call + def bankruptcy_courts_pacer_case_locator_party_search_without_preload_content( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + ssn_or_ein: Annotated[Optional[Annotated[str, Field(strict=True, max_length=9)]], Field(description="The Social Security number or the federal Employer Identification Number of the target party. Either number can be entered with or without dashes.")] = None, + four_digit_ssn: Annotated[Optional[Annotated[str, Field(strict=True, max_length=4)]], Field(description="The last four digits of the Social Security number of the target party. Note: When specified, a last name/entity name must also be specified.")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_discharged_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_discharged_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PACER Case Locator Search API for All Courts. + + Search for the specified party in PACER bankruptcy filings. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param ssn_or_ein: The Social Security number or the federal Employer Identification Number of the target party. Either number can be entered with or without dashes. + :type ssn_or_ein: str + :param four_digit_ssn: The last four digits of the Social Security number of the target party. Note: When specified, a last name/entity name must also be specified. + :type four_digit_ssn: str + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param case_discharged_start_date: The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_start_date: datetime + :param case_discharged_end_date: The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_end_date: datetime + :param case_dismissed_start_date: The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_dismissed_start_date: datetime + :param case_dismissed_end_date: The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_dismissed_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._bankruptcy_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + ssn_or_ein=ssn_or_ein, + four_digit_ssn=four_digit_ssn, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + case_discharged_start_date=case_discharged_start_date, + case_discharged_end_date=case_discharged_end_date, + case_dismissed_start_date=case_dismissed_start_date, + case_dismissed_end_date=case_dismissed_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _bankruptcy_courts_pacer_case_locator_party_search_serialize( self, pacer_user_id, pacer_client_code, - **kwargs - ): - """PACER Case Locator Search API for All Courts. # noqa: E501 - - Search for the specified party in PACER bankruptcy filings. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.bankruptcy_courts_pacer_case_locator_party_search(pacer_user_id, pacer_client_code, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The username of the PACER account under which the search is to be performed. - pacer_client_code (str): The PACER client code under which the search is to be performed. - - Keyword Args: - case_number (str, none_type): The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).. [optional] - pacer_case_id (int): The PACER-assigned identifier of the target case.. [optional] - last_name (str, none_type): The last name (for an individual) or the entity name (for a business entity) of the target party.. [optional] - first_name (str, none_type): The first name of the target party.. [optional] - middle_name (str, none_type): The middle name of the target party.. [optional] - generation (str, none_type): The suffix (e.g., Jr., III) of the target party's name.. [optional] - party_type (str, none_type): The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.. [optional] - party_exact_name_match (bool): Specify whether the search string must match the name of the target party exactly.. [optional] - party_role_array ([str, none_type]): The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.. [optional] - case_title (str, none_type): The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.. [optional] - case_office (int): The divisional office in which the case was filed.. [optional] - case_sequence_number (int): The PACER-assigned sequence number of the target case. Ex 12345. [optional] - case_year (int): The two- or four-digit year in which the target case was filed.. [optional] - case_type_array ([str, none_type]): The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr. [optional] - court_region_id_array ([str, none_type]): The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae. [optional] - case_year_from (int): Limit the results of the search to those cases from the year specified or later. [optional] - case_year_to (int): Limit the results of the search to those cases from the year specified or earlier. [optional] - ssn_or_ein (str, none_type): The Social Security number or the federal Employer Identification Number of the target party. Either number can be entered with or without dashes.. [optional] - four_digit_ssn (str, none_type): The last four digits of the Social Security number of the target party. Note: When specified, a last name/entity name must also be specified.. [optional] - case_filed_start_date (datetime, none_type): The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_filed_end_date (datetime, none_type): The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_start_date (datetime, none_type): The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_end_date (datetime, none_type): The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_discharged_start_date (datetime, none_type): The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.. [optional] - case_discharged_end_date (datetime, none_type): The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.. [optional] - case_dismissed_start_date (datetime, none_type): The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.. [optional] - case_dismissed_end_date (datetime, none_type): The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - sort_parameter_query (str, none_type): How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC. [optional] if omitted the server will use the default value of "lastName,ASC" - case_status (str, none_type): Whether the target case is marked as 'open' or 'closed' within PACER.. [optional] - page_number (int): The page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PCLParty - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_number, + pacer_case_id, + last_name, + first_name, + middle_name, + generation, + party_type, + party_exact_name_match, + party_role_array, + case_title, + case_office, + case_sequence_number, + case_year, + case_type_array, + court_region_id_array, + case_year_from, + case_year_to, + ssn_or_ein, + four_digit_ssn, + case_filed_start_date, + case_filed_end_date, + case_terminated_start_date, + case_terminated_end_date, + case_discharged_start_date, + case_discharged_end_date, + case_dismissed_start_date, + case_dismissed_end_date, + sort_parameter_query, + case_status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'partyRoleArray': 'multi', + 'caseTypeArray': 'multi', + 'courtRegionIdArray': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pacer_user_id is not None: + + _query_params.append(('pacerUserId', pacer_user_id)) + + if pacer_client_code is not None: + + _query_params.append(('pacerClientCode', pacer_client_code)) + + if case_number is not None: + + _query_params.append(('caseNumber', case_number)) + + if pacer_case_id is not None: + + _query_params.append(('pacerCaseId', pacer_case_id)) + + if last_name is not None: + + _query_params.append(('lastName', last_name)) + + if first_name is not None: + + _query_params.append(('firstName', first_name)) + + if middle_name is not None: + + _query_params.append(('middleName', middle_name)) + + if generation is not None: + + _query_params.append(('generation', generation)) + + if party_type is not None: + + _query_params.append(('partyType', party_type)) + + if party_exact_name_match is not None: + + _query_params.append(('partyExactNameMatch', party_exact_name_match)) + + if party_role_array is not None: + + _query_params.append(('partyRoleArray', party_role_array)) + + if case_title is not None: + + _query_params.append(('caseTitle', case_title)) + + if case_office is not None: + + _query_params.append(('caseOffice', case_office)) + + if case_sequence_number is not None: + + _query_params.append(('caseSequenceNumber', case_sequence_number)) + + if case_year is not None: + + _query_params.append(('caseYear', case_year)) + + if case_type_array is not None: + + _query_params.append(('caseTypeArray', case_type_array)) + + if court_region_id_array is not None: + + _query_params.append(('courtRegionIdArray', court_region_id_array)) + + if case_year_from is not None: + + _query_params.append(('caseYearFrom', case_year_from)) + + if case_year_to is not None: + + _query_params.append(('caseYearTo', case_year_to)) + + if ssn_or_ein is not None: + + _query_params.append(('ssnOrEin', ssn_or_ein)) + + if four_digit_ssn is not None: + + _query_params.append(('fourDigitSsn', four_digit_ssn)) + + if case_filed_start_date is not None: + if isinstance(case_filed_start_date, datetime): + _query_params.append( + ( + 'caseFiledStartDate', + case_filed_start_date + ) + ) + else: + _query_params.append(('caseFiledStartDate', case_filed_start_date)) + + if case_filed_end_date is not None: + if isinstance(case_filed_end_date, datetime): + _query_params.append( + ( + 'caseFiledEndDate', + case_filed_end_date + ) + ) + else: + _query_params.append(('caseFiledEndDate', case_filed_end_date)) + + if case_terminated_start_date is not None: + if isinstance(case_terminated_start_date, datetime): + _query_params.append( + ( + 'caseTerminatedStartDate', + case_terminated_start_date + ) + ) + else: + _query_params.append(('caseTerminatedStartDate', case_terminated_start_date)) + + if case_terminated_end_date is not None: + if isinstance(case_terminated_end_date, datetime): + _query_params.append( + ( + 'caseTerminatedEndDate', + case_terminated_end_date + ) + ) + else: + _query_params.append(('caseTerminatedEndDate', case_terminated_end_date)) + + if case_discharged_start_date is not None: + if isinstance(case_discharged_start_date, datetime): + _query_params.append( + ( + 'caseDischargedStartDate', + case_discharged_start_date + ) + ) + else: + _query_params.append(('caseDischargedStartDate', case_discharged_start_date)) + + if case_discharged_end_date is not None: + if isinstance(case_discharged_end_date, datetime): + _query_params.append( + ( + 'caseDischargedEndDate', + case_discharged_end_date + ) + ) + else: + _query_params.append(('caseDischargedEndDate', case_discharged_end_date)) + + if case_dismissed_start_date is not None: + if isinstance(case_dismissed_start_date, datetime): + _query_params.append( + ( + 'caseDismissedStartDate', + case_dismissed_start_date + ) + ) + else: + _query_params.append(('caseDismissedStartDate', case_dismissed_start_date)) + + if case_dismissed_end_date is not None: + if isinstance(case_dismissed_end_date, datetime): + _query_params.append( + ( + 'caseDismissedEndDate', + case_dismissed_end_date + ) + ) + else: + _query_params.append(('caseDismissedEndDate', case_dismissed_end_date)) + + if sort_parameter_query is not None: + + _query_params.append(('sortParameterQuery', sort_parameter_query)) + + if case_status is not None: + + _query_params.append(('caseStatus', case_status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacerCaseLocator/partySearch/bankruptcyCourts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def civil_courts_pacer_case_locator_case_search( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case.")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + nature_of_suits_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 110 (Insurance) and 140 (Negotiable Instrument), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=110&natureOfSuitsArray=140")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PCLCase: + """PACER Case Locator Search API for All Courts. + + Search for civil cases filed in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param nature_of_suits_array: The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 110 (Insurance) and 140 (Negotiable Instrument), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=110&natureOfSuitsArray=140 + :type nature_of_suits_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._civil_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + nature_of_suits_array=nature_of_suits_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def civil_courts_pacer_case_locator_case_search_with_http_info( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case.")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + nature_of_suits_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 110 (Insurance) and 140 (Negotiable Instrument), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=110&natureOfSuitsArray=140")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLCase]: + """PACER Case Locator Search API for All Courts. + + Search for civil cases filed in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param nature_of_suits_array: The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 110 (Insurance) and 140 (Negotiable Instrument), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=110&natureOfSuitsArray=140 + :type nature_of_suits_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._civil_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + nature_of_suits_array=nature_of_suits_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def civil_courts_pacer_case_locator_case_search_without_preload_content( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case.")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + nature_of_suits_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 110 (Insurance) and 140 (Negotiable Instrument), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=110&natureOfSuitsArray=140")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PACER Case Locator Search API for All Courts. + + Search for civil cases filed in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param nature_of_suits_array: The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 110 (Insurance) and 140 (Negotiable Instrument), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=110&natureOfSuitsArray=140 + :type nature_of_suits_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._civil_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + nature_of_suits_array=nature_of_suits_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - kwargs['pacer_client_code'] = \ - pacer_client_code - return self.bankruptcy_courts_pacer_case_locator_party_search_endpoint.call_with_http_info(**kwargs) + return response_data.response - def civil_courts_pacer_case_locator_case_search( + + def _civil_courts_pacer_case_locator_case_search_serialize( self, pacer_user_id, pacer_client_code, - **kwargs - ): - """PACER Case Locator Search API for All Courts. # noqa: E501 - - Search for civil cases filed in PACER. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.civil_courts_pacer_case_locator_case_search(pacer_user_id, pacer_client_code, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The username of the PACER account under which the search is to be performed. - pacer_client_code (str): The PACER client code under which the search is to be performed. - - Keyword Args: - case_number (str, none_type): The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).. [optional] - pacer_case_id (int): The PACER-assigned identifier of the target case.. [optional] - case_title (str, none_type): The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.. [optional] - case_office (int): The divisional office in which the case was filed.. [optional] - case_sequence_number (int): The PACER-assigned sequence number of the target case.. [optional] - case_year (int): The two- or four-digit year in which the target case was filed.. [optional] - case_type_array ([str, none_type]): The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr. [optional] - nature_of_suits_array ([str, none_type]): The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 110 (Insurance) and 140 (Negotiable Instrument), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=110&natureOfSuitsArray=140. [optional] - court_region_id_array ([str, none_type]): The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae. [optional] - case_filed_start_date (datetime, none_type): The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_filed_end_date (datetime, none_type): The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_start_date (datetime, none_type): The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_end_date (datetime, none_type): The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - sort_parameter_query (str, none_type): How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC. [optional] if omitted the server will use the default value of "caseYear,DESC" - case_status (str, none_type): Whether the target case is marked as 'open' or 'closed' within PACER.. [optional] - page_number (int): The page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PCLCase - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_number, + pacer_case_id, + case_title, + case_office, + case_sequence_number, + case_year, + case_type_array, + nature_of_suits_array, + court_region_id_array, + case_filed_start_date, + case_filed_end_date, + case_terminated_start_date, + case_terminated_end_date, + sort_parameter_query, + case_status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'caseTypeArray': 'multi', + 'natureOfSuitsArray': 'multi', + 'courtRegionIdArray': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pacer_user_id is not None: + + _query_params.append(('pacerUserId', pacer_user_id)) + + if pacer_client_code is not None: + + _query_params.append(('pacerClientCode', pacer_client_code)) + + if case_number is not None: + + _query_params.append(('caseNumber', case_number)) + + if pacer_case_id is not None: + + _query_params.append(('pacerCaseId', pacer_case_id)) + + if case_title is not None: + + _query_params.append(('caseTitle', case_title)) + + if case_office is not None: + + _query_params.append(('caseOffice', case_office)) + + if case_sequence_number is not None: + + _query_params.append(('caseSequenceNumber', case_sequence_number)) + + if case_year is not None: + + _query_params.append(('caseYear', case_year)) + + if case_type_array is not None: + + _query_params.append(('caseTypeArray', case_type_array)) + + if nature_of_suits_array is not None: + + _query_params.append(('natureOfSuitsArray', nature_of_suits_array)) + + if court_region_id_array is not None: + + _query_params.append(('courtRegionIdArray', court_region_id_array)) + + if case_filed_start_date is not None: + if isinstance(case_filed_start_date, datetime): + _query_params.append( + ( + 'caseFiledStartDate', + case_filed_start_date + ) + ) + else: + _query_params.append(('caseFiledStartDate', case_filed_start_date)) + + if case_filed_end_date is not None: + if isinstance(case_filed_end_date, datetime): + _query_params.append( + ( + 'caseFiledEndDate', + case_filed_end_date + ) + ) + else: + _query_params.append(('caseFiledEndDate', case_filed_end_date)) + + if case_terminated_start_date is not None: + if isinstance(case_terminated_start_date, datetime): + _query_params.append( + ( + 'caseTerminatedStartDate', + case_terminated_start_date + ) + ) + else: + _query_params.append(('caseTerminatedStartDate', case_terminated_start_date)) + + if case_terminated_end_date is not None: + if isinstance(case_terminated_end_date, datetime): + _query_params.append( + ( + 'caseTerminatedEndDate', + case_terminated_end_date + ) + ) + else: + _query_params.append(('caseTerminatedEndDate', case_terminated_end_date)) + + if sort_parameter_query is not None: + + _query_params.append(('sortParameterQuery', sort_parameter_query)) + + if case_status is not None: + + _query_params.append(('caseStatus', case_status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacerCaseLocator/caseSearch/civilCourts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def civil_courts_pacer_case_locator_party_search( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The name suffix (e.g., III, MD).")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PCLParty: + """PACER Case Locator Search API for All Courts. + + Search for the specified party in civil cases filed in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The name suffix (e.g., III, MD). + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._civil_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def civil_courts_pacer_case_locator_party_search_with_http_info( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The name suffix (e.g., III, MD).")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLParty]: + """PACER Case Locator Search API for All Courts. + + Search for the specified party in civil cases filed in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The name suffix (e.g., III, MD). + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._civil_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def civil_courts_pacer_case_locator_party_search_without_preload_content( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The name suffix (e.g., III, MD).")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PACER Case Locator Search API for All Courts. + + Search for the specified party in civil cases filed in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The name suffix (e.g., III, MD). + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._civil_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - kwargs['pacer_client_code'] = \ - pacer_client_code - return self.civil_courts_pacer_case_locator_case_search_endpoint.call_with_http_info(**kwargs) + return response_data.response - def civil_courts_pacer_case_locator_party_search( + + def _civil_courts_pacer_case_locator_party_search_serialize( self, pacer_user_id, pacer_client_code, - **kwargs - ): - """PACER Case Locator Search API for All Courts. # noqa: E501 - - Search for the specified party in civil cases filed in PACER. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.civil_courts_pacer_case_locator_party_search(pacer_user_id, pacer_client_code, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The username of the PACER account under which the search is to be performed. - pacer_client_code (str): The PACER client code under which the search is to be performed. - - Keyword Args: - case_number (str, none_type): The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).. [optional] - pacer_case_id (int): The PACER-assigned identifier of the target case.. [optional] - last_name (str, none_type): The last name (for an individual) or the entity name (for a business entity) of the target party.. [optional] - first_name (str, none_type): The first name of the target party.. [optional] - middle_name (str, none_type): The middle name of the target party.. [optional] - generation (str, none_type): The name suffix (e.g., III, MD).. [optional] - party_type (str, none_type): The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.. [optional] - party_exact_name_match (bool): Specify whether the search string must match the name of the target party exactly.. [optional] - party_role_array ([str, none_type]): The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.. [optional] - case_title (str, none_type): The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.. [optional] - case_office (int): The divisional office in which the case was filed.. [optional] - case_sequence_number (int): The PACER-assigned sequence number of the target case. Ex 12345. [optional] - case_year (int): The two- or four-digit year in which the target case was filed.. [optional] - case_type_array ([str, none_type]): The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr. [optional] - court_region_id_array ([str, none_type]): The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae. [optional] - case_year_from (int): Limit the results of the search to those cases from the year specified or later. [optional] - case_year_to (int): Limit the results of the search to those cases from the year specified or earlier. [optional] - case_filed_start_date (datetime, none_type): The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_filed_end_date (datetime, none_type): The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_start_date (datetime, none_type): The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_end_date (datetime, none_type): The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - sort_parameter_query (str, none_type): How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC. [optional] if omitted the server will use the default value of "lastName,ASC" - case_status (str, none_type): Whether the target case is marked as 'open' or 'closed' within PACER.. [optional] - page_number (int): The page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PCLParty - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_number, + pacer_case_id, + last_name, + first_name, + middle_name, + generation, + party_type, + party_exact_name_match, + party_role_array, + case_title, + case_office, + case_sequence_number, + case_year, + case_type_array, + court_region_id_array, + case_year_from, + case_year_to, + case_filed_start_date, + case_filed_end_date, + case_terminated_start_date, + case_terminated_end_date, + sort_parameter_query, + case_status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'partyRoleArray': 'multi', + 'caseTypeArray': 'multi', + 'courtRegionIdArray': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pacer_user_id is not None: + + _query_params.append(('pacerUserId', pacer_user_id)) + + if pacer_client_code is not None: + + _query_params.append(('pacerClientCode', pacer_client_code)) + + if case_number is not None: + + _query_params.append(('caseNumber', case_number)) + + if pacer_case_id is not None: + + _query_params.append(('pacerCaseId', pacer_case_id)) + + if last_name is not None: + + _query_params.append(('lastName', last_name)) + + if first_name is not None: + + _query_params.append(('firstName', first_name)) + + if middle_name is not None: + + _query_params.append(('middleName', middle_name)) + + if generation is not None: + + _query_params.append(('generation', generation)) + + if party_type is not None: + + _query_params.append(('partyType', party_type)) + + if party_exact_name_match is not None: + + _query_params.append(('partyExactNameMatch', party_exact_name_match)) + + if party_role_array is not None: + + _query_params.append(('partyRoleArray', party_role_array)) + + if case_title is not None: + + _query_params.append(('caseTitle', case_title)) + + if case_office is not None: + + _query_params.append(('caseOffice', case_office)) + + if case_sequence_number is not None: + + _query_params.append(('caseSequenceNumber', case_sequence_number)) + + if case_year is not None: + + _query_params.append(('caseYear', case_year)) + + if case_type_array is not None: + + _query_params.append(('caseTypeArray', case_type_array)) + + if court_region_id_array is not None: + + _query_params.append(('courtRegionIdArray', court_region_id_array)) + + if case_year_from is not None: + + _query_params.append(('caseYearFrom', case_year_from)) + + if case_year_to is not None: + + _query_params.append(('caseYearTo', case_year_to)) + + if case_filed_start_date is not None: + if isinstance(case_filed_start_date, datetime): + _query_params.append( + ( + 'caseFiledStartDate', + case_filed_start_date + ) + ) + else: + _query_params.append(('caseFiledStartDate', case_filed_start_date)) + + if case_filed_end_date is not None: + if isinstance(case_filed_end_date, datetime): + _query_params.append( + ( + 'caseFiledEndDate', + case_filed_end_date + ) + ) + else: + _query_params.append(('caseFiledEndDate', case_filed_end_date)) + + if case_terminated_start_date is not None: + if isinstance(case_terminated_start_date, datetime): + _query_params.append( + ( + 'caseTerminatedStartDate', + case_terminated_start_date + ) + ) + else: + _query_params.append(('caseTerminatedStartDate', case_terminated_start_date)) + + if case_terminated_end_date is not None: + if isinstance(case_terminated_end_date, datetime): + _query_params.append( + ( + 'caseTerminatedEndDate', + case_terminated_end_date + ) + ) + else: + _query_params.append(('caseTerminatedEndDate', case_terminated_end_date)) + + if sort_parameter_query is not None: + + _query_params.append(('sortParameterQuery', sort_parameter_query)) + + if case_status is not None: + + _query_params.append(('caseStatus', case_status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacerCaseLocator/partySearch/civilCourts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def criminal_courts_pacer_case_locator_case_search( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PCLCase: + """PACER Case Locator Search API for All Courts. + + Search for criminal cases in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._criminal_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def criminal_courts_pacer_case_locator_case_search_with_http_info( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLCase]: + """PACER Case Locator Search API for All Courts. + + Search for criminal cases in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._criminal_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - kwargs['pacer_client_code'] = \ - pacer_client_code - return self.civil_courts_pacer_case_locator_party_search_endpoint.call_with_http_info(**kwargs) - def criminal_courts_pacer_case_locator_case_search( + + @validate_call + def criminal_courts_pacer_case_locator_case_search_without_preload_content( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PACER Case Locator Search API for All Courts. + + Search for criminal cases in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._criminal_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _criminal_courts_pacer_case_locator_case_search_serialize( self, pacer_user_id, pacer_client_code, - **kwargs - ): - """PACER Case Locator Search API for All Courts. # noqa: E501 - - Search for criminal cases in PACER. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.criminal_courts_pacer_case_locator_case_search(pacer_user_id, pacer_client_code, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The username of the PACER account under which the search is to be performed. - pacer_client_code (str): The PACER client code under which the search is to be performed. - - Keyword Args: - case_number (str, none_type): The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).. [optional] - pacer_case_id (int): The PACER-assigned identifier of the target case.. [optional] - case_title (str, none_type): The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.. [optional] - case_office (int): The divisional office in which the case was filed.. [optional] - case_sequence_number (int): The PACER-assigned sequence number of the target case. Ex 12345. [optional] - case_year (int): The two- or four-digit year in which the target case was filed.. [optional] - case_type_array ([str, none_type]): The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr. [optional] - court_region_id_array ([str, none_type]): The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae. [optional] - case_filed_start_date (datetime, none_type): The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_filed_end_date (datetime, none_type): The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_start_date (datetime, none_type): The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_end_date (datetime, none_type): The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - sort_parameter_query (str, none_type): How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC. [optional] if omitted the server will use the default value of "caseYear,DESC" - case_status (str, none_type): Whether the target case is marked as 'open' or 'closed' within PACER.. [optional] - page_number (int): The page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PCLCase - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_number, + pacer_case_id, + case_title, + case_office, + case_sequence_number, + case_year, + case_type_array, + court_region_id_array, + case_filed_start_date, + case_filed_end_date, + case_terminated_start_date, + case_terminated_end_date, + sort_parameter_query, + case_status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'caseTypeArray': 'multi', + 'courtRegionIdArray': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pacer_user_id is not None: + + _query_params.append(('pacerUserId', pacer_user_id)) + + if pacer_client_code is not None: + + _query_params.append(('pacerClientCode', pacer_client_code)) + + if case_number is not None: + + _query_params.append(('caseNumber', case_number)) + + if pacer_case_id is not None: + + _query_params.append(('pacerCaseId', pacer_case_id)) + + if case_title is not None: + + _query_params.append(('caseTitle', case_title)) + + if case_office is not None: + + _query_params.append(('caseOffice', case_office)) + + if case_sequence_number is not None: + + _query_params.append(('caseSequenceNumber', case_sequence_number)) + + if case_year is not None: + + _query_params.append(('caseYear', case_year)) + + if case_type_array is not None: + + _query_params.append(('caseTypeArray', case_type_array)) + + if court_region_id_array is not None: + + _query_params.append(('courtRegionIdArray', court_region_id_array)) + + if case_filed_start_date is not None: + if isinstance(case_filed_start_date, datetime): + _query_params.append( + ( + 'caseFiledStartDate', + case_filed_start_date + ) + ) + else: + _query_params.append(('caseFiledStartDate', case_filed_start_date)) + + if case_filed_end_date is not None: + if isinstance(case_filed_end_date, datetime): + _query_params.append( + ( + 'caseFiledEndDate', + case_filed_end_date + ) + ) + else: + _query_params.append(('caseFiledEndDate', case_filed_end_date)) + + if case_terminated_start_date is not None: + if isinstance(case_terminated_start_date, datetime): + _query_params.append( + ( + 'caseTerminatedStartDate', + case_terminated_start_date + ) + ) + else: + _query_params.append(('caseTerminatedStartDate', case_terminated_start_date)) + + if case_terminated_end_date is not None: + if isinstance(case_terminated_end_date, datetime): + _query_params.append( + ( + 'caseTerminatedEndDate', + case_terminated_end_date + ) + ) + else: + _query_params.append(('caseTerminatedEndDate', case_terminated_end_date)) + + if sort_parameter_query is not None: + + _query_params.append(('sortParameterQuery', sort_parameter_query)) + + if case_status is not None: + + _query_params.append(('caseStatus', case_status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacerCaseLocator/caseSearch/criminalCourts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def criminal_courts_pacer_case_locator_party_search( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PCLParty: + """PACER Case Locator Search API for All Courts. + + Search for the specified party in PACER criminal cases. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._criminal_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def criminal_courts_pacer_case_locator_party_search_with_http_info( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLParty]: + """PACER Case Locator Search API for All Courts. + + Search for the specified party in PACER criminal cases. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._criminal_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def criminal_courts_pacer_case_locator_party_search_without_preload_content( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PACER Case Locator Search API for All Courts. + + Search for the specified party in PACER criminal cases. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._criminal_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - kwargs['pacer_client_code'] = \ - pacer_client_code - return self.criminal_courts_pacer_case_locator_case_search_endpoint.call_with_http_info(**kwargs) + return response_data.response - def criminal_courts_pacer_case_locator_party_search( + + def _criminal_courts_pacer_case_locator_party_search_serialize( self, pacer_user_id, pacer_client_code, - **kwargs - ): - """PACER Case Locator Search API for All Courts. # noqa: E501 - - Search for the specified party in PACER criminal cases. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.criminal_courts_pacer_case_locator_party_search(pacer_user_id, pacer_client_code, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The username of the PACER account under which the search is to be performed. - pacer_client_code (str): The PACER client code under which the search is to be performed. - - Keyword Args: - case_number (str, none_type): The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).. [optional] - pacer_case_id (int): The PACER-assigned identifier of the target case.. [optional] - last_name (str, none_type): The last name (for an individual) or the entity name (for a business entity) of the target party.. [optional] - first_name (str, none_type): The first name of the target party.. [optional] - middle_name (str, none_type): The middle name of the target party.. [optional] - generation (str, none_type): The suffix (e.g., Jr., III) of the target party's name.. [optional] - party_type (str, none_type): The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.. [optional] - party_exact_name_match (bool): Specify whether the search string must match the name of the target party exactly.. [optional] - party_role_array ([str, none_type]): The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.. [optional] - case_title (str, none_type): The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.. [optional] - case_office (int): The divisional office in which the case was filed.. [optional] - case_sequence_number (int): The PACER-assigned sequence number of the target case. Ex 12345. [optional] - case_year (int): The two- or four-digit year in which the target case was filed.. [optional] - case_type_array ([str, none_type]): The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr. [optional] - court_region_id_array ([str, none_type]): The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae. [optional] - case_year_from (int): Limit the results of the search to those cases from the year specified or later. [optional] - case_year_to (int): Limit the results of the search to those cases from the year specified or earlier. [optional] - case_filed_start_date (datetime, none_type): The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_filed_end_date (datetime, none_type): The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_start_date (datetime, none_type): The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_end_date (datetime, none_type): The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - sort_parameter_query (str, none_type): How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC. [optional] if omitted the server will use the default value of "lastName,ASC" - case_status (str, none_type): Whether the target case is marked as 'open' or 'closed' within PACER.. [optional] - page_number (int): The page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PCLParty - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + case_number, + pacer_case_id, + last_name, + first_name, + middle_name, + generation, + party_type, + party_exact_name_match, + party_role_array, + case_title, + case_office, + case_sequence_number, + case_year, + case_type_array, + court_region_id_array, + case_year_from, + case_year_to, + case_filed_start_date, + case_filed_end_date, + case_terminated_start_date, + case_terminated_end_date, + sort_parameter_query, + case_status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'partyRoleArray': 'multi', + 'caseTypeArray': 'multi', + 'courtRegionIdArray': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pacer_user_id is not None: + + _query_params.append(('pacerUserId', pacer_user_id)) + + if pacer_client_code is not None: + + _query_params.append(('pacerClientCode', pacer_client_code)) + + if case_number is not None: + + _query_params.append(('caseNumber', case_number)) + + if pacer_case_id is not None: + + _query_params.append(('pacerCaseId', pacer_case_id)) + + if last_name is not None: + + _query_params.append(('lastName', last_name)) + + if first_name is not None: + + _query_params.append(('firstName', first_name)) + + if middle_name is not None: + + _query_params.append(('middleName', middle_name)) + + if generation is not None: + + _query_params.append(('generation', generation)) + + if party_type is not None: + + _query_params.append(('partyType', party_type)) + + if party_exact_name_match is not None: + + _query_params.append(('partyExactNameMatch', party_exact_name_match)) + + if party_role_array is not None: + + _query_params.append(('partyRoleArray', party_role_array)) + + if case_title is not None: + + _query_params.append(('caseTitle', case_title)) + + if case_office is not None: + + _query_params.append(('caseOffice', case_office)) + + if case_sequence_number is not None: + + _query_params.append(('caseSequenceNumber', case_sequence_number)) + + if case_year is not None: + + _query_params.append(('caseYear', case_year)) + + if case_type_array is not None: + + _query_params.append(('caseTypeArray', case_type_array)) + + if court_region_id_array is not None: + + _query_params.append(('courtRegionIdArray', court_region_id_array)) + + if case_year_from is not None: + + _query_params.append(('caseYearFrom', case_year_from)) + + if case_year_to is not None: + + _query_params.append(('caseYearTo', case_year_to)) + + if case_filed_start_date is not None: + if isinstance(case_filed_start_date, datetime): + _query_params.append( + ( + 'caseFiledStartDate', + case_filed_start_date + ) + ) + else: + _query_params.append(('caseFiledStartDate', case_filed_start_date)) + + if case_filed_end_date is not None: + if isinstance(case_filed_end_date, datetime): + _query_params.append( + ( + 'caseFiledEndDate', + case_filed_end_date + ) + ) + else: + _query_params.append(('caseFiledEndDate', case_filed_end_date)) + + if case_terminated_start_date is not None: + if isinstance(case_terminated_start_date, datetime): + _query_params.append( + ( + 'caseTerminatedStartDate', + case_terminated_start_date + ) + ) + else: + _query_params.append(('caseTerminatedStartDate', case_terminated_start_date)) + + if case_terminated_end_date is not None: + if isinstance(case_terminated_end_date, datetime): + _query_params.append( + ( + 'caseTerminatedEndDate', + case_terminated_end_date + ) + ) + else: + _query_params.append(('caseTerminatedEndDate', case_terminated_end_date)) + + if sort_parameter_query is not None: + + _query_params.append(('sortParameterQuery', sort_parameter_query)) + + if case_status is not None: + + _query_params.append(('caseStatus', case_status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacerCaseLocator/partySearch/criminalCourts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def import_pacer_case_by_court_using_case_number( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The PACER username of the PACER account under which the case should be imported.")], + case_number: Annotated[str, Field(min_length=3, strict=True, max_length=50, description="The case number of the case to be imported.")], + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the court from which the case is to be imported.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PACERImportCase: + """Find PACER Case for a requested Case Number and Court. + + Import the specified case from PACER. Workflow: 1.This API will return the Find Case results from the court site in a form of array of UniCourt Case Objects. These case objects will consists only Meta information of the case if not already present in the UniCourt Database. 2.To get the full updated case information one will have to request the caseUpdate API by passing the caseId. Note: 1.Charges for Find Case in District, Bankruptcy and National Courts is free. Find case for Appeal Courts will be charged at minimum rate of $0.1. The fee charged by the court for find case can be found in the response of this API in the field courtFee. 2.The results of the search has less Meta information in case objects compared to the Meta information of cases found using the PCL search APIs. + + :param pacer_user_id: The PACER username of the PACER account under which the case should be imported. (required) + :type pacer_user_id: str + :param case_number: The case number of the case to be imported. (required) + :type case_number: str + :param court_id: The courtId value of the court from which the case is to be imported. (required) + :type court_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_pacer_case_by_court_using_case_number_serialize( + pacer_user_id=pacer_user_id, + case_number=case_number, + court_id=court_id, + pacer_client_code=pacer_client_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PACERImportCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def import_pacer_case_by_court_using_case_number_with_http_info( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The PACER username of the PACER account under which the case should be imported.")], + case_number: Annotated[str, Field(min_length=3, strict=True, max_length=50, description="The case number of the case to be imported.")], + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the court from which the case is to be imported.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PACERImportCase]: + """Find PACER Case for a requested Case Number and Court. + + Import the specified case from PACER. Workflow: 1.This API will return the Find Case results from the court site in a form of array of UniCourt Case Objects. These case objects will consists only Meta information of the case if not already present in the UniCourt Database. 2.To get the full updated case information one will have to request the caseUpdate API by passing the caseId. Note: 1.Charges for Find Case in District, Bankruptcy and National Courts is free. Find case for Appeal Courts will be charged at minimum rate of $0.1. The fee charged by the court for find case can be found in the response of this API in the field courtFee. 2.The results of the search has less Meta information in case objects compared to the Meta information of cases found using the PCL search APIs. + + :param pacer_user_id: The PACER username of the PACER account under which the case should be imported. (required) + :type pacer_user_id: str + :param case_number: The case number of the case to be imported. (required) + :type case_number: str + :param court_id: The courtId value of the court from which the case is to be imported. (required) + :type court_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_pacer_case_by_court_using_case_number_serialize( + pacer_user_id=pacer_user_id, + case_number=case_number, + court_id=court_id, + pacer_client_code=pacer_client_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PACERImportCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - kwargs['pacer_client_code'] = \ - pacer_client_code - return self.criminal_courts_pacer_case_locator_party_search_endpoint.call_with_http_info(**kwargs) - def import_pacer_case_by_court_using_case_number( + + @validate_call + def import_pacer_case_by_court_using_case_number_without_preload_content( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The PACER username of the PACER account under which the case should be imported.")], + case_number: Annotated[str, Field(min_length=3, strict=True, max_length=50, description="The case number of the case to be imported.")], + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the court from which the case is to be imported.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Find PACER Case for a requested Case Number and Court. + + Import the specified case from PACER. Workflow: 1.This API will return the Find Case results from the court site in a form of array of UniCourt Case Objects. These case objects will consists only Meta information of the case if not already present in the UniCourt Database. 2.To get the full updated case information one will have to request the caseUpdate API by passing the caseId. Note: 1.Charges for Find Case in District, Bankruptcy and National Courts is free. Find case for Appeal Courts will be charged at minimum rate of $0.1. The fee charged by the court for find case can be found in the response of this API in the field courtFee. 2.The results of the search has less Meta information in case objects compared to the Meta information of cases found using the PCL search APIs. + + :param pacer_user_id: The PACER username of the PACER account under which the case should be imported. (required) + :type pacer_user_id: str + :param case_number: The case number of the case to be imported. (required) + :type case_number: str + :param court_id: The courtId value of the court from which the case is to be imported. (required) + :type court_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_pacer_case_by_court_using_case_number_serialize( + pacer_user_id=pacer_user_id, + case_number=case_number, + court_id=court_id, + pacer_client_code=pacer_client_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PACERImportCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _import_pacer_case_by_court_using_case_number_serialize( self, pacer_user_id, - pacer_client_code, case_number, court_id, - **kwargs - ): - """Find PACER Case for a requested Case Number and Court. # noqa: E501 - - Import the specified case from PACER. Workflow: 1.This API will return the Find Case results from the court site in a form of array of UniCourt Case Objects. These case objects will consists only Meta information of the case if not already present in the UniCourt Database. 2.To get the full updated case information one will have to request the caseUpdate API by passing the caseId. Note: 1.Charges for Find Case in District, Bankruptcy and National Courts is free. Find case for Appeal Courts will be charged at minimum rate of $0.1. The fee charged by the court for find case can be found in the response of this API in the field courtFee. 2.The results of the search has less Meta information in case objects compared to the Meta information of cases found using the PCL search APIs. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.import_pacer_case_by_court_using_case_number(pacer_user_id, pacer_client_code, case_number, court_id, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The PACER username of the PACER account under which the case should be imported. - pacer_client_code (str): The PACER client code under which the case should be imported. - case_number (str): The case number of the case to be imported. - court_id (str): The courtId value of the court from which the case is to be imported. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PACERImportCase - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + pacer_client_code, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pacer_user_id is not None: + + _query_params.append(('pacerUserId', pacer_user_id)) + + if pacer_client_code is not None: + + _query_params.append(('pacerClientCode', pacer_client_code)) + + if case_number is not None: + + _query_params.append(('caseNumber', case_number)) + + if court_id is not None: + + _query_params.append(('courtId', court_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacer/importCaseByCourtUsingCaseNumber', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def multi_district_courts_pacer_case_locator_case_search( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + jpml_number: Annotated[Optional[StrictInt], Field(description="Master JPML Case Number.")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PCLCase: + """PACER Case Locator Search API for All Courts. + + Search for multidistrict litigation in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param jpml_number: Master JPML Case Number. + :type jpml_number: int + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._multi_district_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + jpml_number=jpml_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def multi_district_courts_pacer_case_locator_case_search_with_http_info( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + jpml_number: Annotated[Optional[StrictInt], Field(description="Master JPML Case Number.")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLCase]: + """PACER Case Locator Search API for All Courts. + + Search for multidistrict litigation in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param jpml_number: Master JPML Case Number. + :type jpml_number: int + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._multi_district_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + jpml_number=jpml_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - kwargs['pacer_client_code'] = \ - pacer_client_code - kwargs['case_number'] = \ - case_number - kwargs['court_id'] = \ - court_id - return self.import_pacer_case_by_court_using_case_number_endpoint.call_with_http_info(**kwargs) - def multi_district_courts_pacer_case_locator_case_search( + + @validate_call + def multi_district_courts_pacer_case_locator_case_search_without_preload_content( self, - pacer_user_id, - pacer_client_code, - **kwargs - ): - """PACER Case Locator Search API for All Courts. # noqa: E501 - - Search for multidistrict litigation in PACER. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.multi_district_courts_pacer_case_locator_case_search(pacer_user_id, pacer_client_code, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The username of the PACER account under which the search is to be performed. - pacer_client_code (str): The PACER client code under which the search is to be performed. - - Keyword Args: - case_number (str, none_type): The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).. [optional] - jpml_number (int): Master JPML Case Number.. [optional] - pacer_case_id (int): The PACER-assigned identifier of the target case.. [optional] - case_title (str, none_type): The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.. [optional] - case_office (int): The divisional office in which the case was filed.. [optional] - case_sequence_number (int): The PACER-assigned sequence number of the target case. Ex 12345. [optional] - case_year (int): The two- or four-digit year in which the target case was filed.. [optional] - case_type_array ([str, none_type]): The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr. [optional] - court_region_id_array ([str, none_type]): The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae. [optional] - case_filed_start_date (datetime, none_type): The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_filed_end_date (datetime, none_type): The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_start_date (datetime, none_type): The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_end_date (datetime, none_type): The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - sort_parameter_query (str, none_type): How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC. [optional] if omitted the server will use the default value of "caseYear,DESC" - case_status (str, none_type): Whether the target case is marked as 'open' or 'closed' within PACER.. [optional] - page_number (int): The page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PCLCase - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + jpml_number: Annotated[Optional[StrictInt], Field(description="Master JPML Case Number.")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PACER Case Locator Search API for All Courts. + + Search for multidistrict litigation in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param jpml_number: Master JPML Case Number. + :type jpml_number: int + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._multi_district_courts_pacer_case_locator_case_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + jpml_number=jpml_number, + pacer_case_id=pacer_case_id, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLCase", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + return response_data.response + + + def _multi_district_courts_pacer_case_locator_case_search_serialize( + self, + pacer_user_id, + pacer_client_code, + case_number, + jpml_number, + pacer_case_id, + case_title, + case_office, + case_sequence_number, + case_year, + case_type_array, + court_region_id_array, + case_filed_start_date, + case_filed_end_date, + case_terminated_start_date, + case_terminated_end_date, + sort_parameter_query, + case_status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'caseTypeArray': 'multi', + 'courtRegionIdArray': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pacer_user_id is not None: + + _query_params.append(('pacerUserId', pacer_user_id)) + + if pacer_client_code is not None: + + _query_params.append(('pacerClientCode', pacer_client_code)) + + if case_number is not None: + + _query_params.append(('caseNumber', case_number)) + + if jpml_number is not None: + + _query_params.append(('jpmlNumber', jpml_number)) + + if pacer_case_id is not None: + + _query_params.append(('pacerCaseId', pacer_case_id)) + + if case_title is not None: + + _query_params.append(('caseTitle', case_title)) + + if case_office is not None: + + _query_params.append(('caseOffice', case_office)) + + if case_sequence_number is not None: + + _query_params.append(('caseSequenceNumber', case_sequence_number)) + + if case_year is not None: + + _query_params.append(('caseYear', case_year)) + + if case_type_array is not None: + + _query_params.append(('caseTypeArray', case_type_array)) + + if court_region_id_array is not None: + + _query_params.append(('courtRegionIdArray', court_region_id_array)) + + if case_filed_start_date is not None: + if isinstance(case_filed_start_date, datetime): + _query_params.append( + ( + 'caseFiledStartDate', + case_filed_start_date + ) + ) + else: + _query_params.append(('caseFiledStartDate', case_filed_start_date)) + + if case_filed_end_date is not None: + if isinstance(case_filed_end_date, datetime): + _query_params.append( + ( + 'caseFiledEndDate', + case_filed_end_date + ) + ) + else: + _query_params.append(('caseFiledEndDate', case_filed_end_date)) + + if case_terminated_start_date is not None: + if isinstance(case_terminated_start_date, datetime): + _query_params.append( + ( + 'caseTerminatedStartDate', + case_terminated_start_date + ) + ) + else: + _query_params.append(('caseTerminatedStartDate', case_terminated_start_date)) + + if case_terminated_end_date is not None: + if isinstance(case_terminated_end_date, datetime): + _query_params.append( + ( + 'caseTerminatedEndDate', + case_terminated_end_date + ) + ) + else: + _query_params.append(('caseTerminatedEndDate', case_terminated_end_date)) + + if sort_parameter_query is not None: + + _query_params.append(('sortParameterQuery', sort_parameter_query)) + + if case_status is not None: + + _query_params.append(('caseStatus', case_status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacerCaseLocator/caseSearch/multiDistrictCourts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + + + @validate_call + def multi_district_courts_pacer_case_locator_party_search( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + jpml_number: Annotated[Optional[StrictInt], Field(description="Master JPML Case Number.")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PCLParty: + """PACER Case Locator Search API for All Courts. + + Search for the specified party in multidistrict litigation in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param jpml_number: Master JPML Case Number. + :type jpml_number: int + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._multi_district_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + jpml_number=jpml_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - kwargs['pacer_client_code'] = \ - pacer_client_code - return self.multi_district_courts_pacer_case_locator_case_search_endpoint.call_with_http_info(**kwargs) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data - def multi_district_courts_pacer_case_locator_party_search( + + @validate_call + def multi_district_courts_pacer_case_locator_party_search_with_http_info( self, - pacer_user_id, - pacer_client_code, - **kwargs - ): - """PACER Case Locator Search API for All Courts. # noqa: E501 - - Search for the specified party in multidistrict litigation in PACER. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.multi_district_courts_pacer_case_locator_party_search(pacer_user_id, pacer_client_code, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The username of the PACER account under which the search is to be performed. - pacer_client_code (str): The PACER client code under which the search is to be performed. - - Keyword Args: - case_number (str, none_type): The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).. [optional] - jpml_number (int): Master JPML Case Number.. [optional] - pacer_case_id (int): The PACER-assigned identifier of the target case.. [optional] - last_name (str, none_type): The last name (for an individual) or the entity name (for a business entity) of the target party.. [optional] - first_name (str, none_type): The first name of the target party.. [optional] - middle_name (str, none_type): The middle name of the target party.. [optional] - generation (str, none_type): The suffix (e.g., Jr., III) of the target party's name.. [optional] - party_type (str, none_type): The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.. [optional] - party_exact_name_match (bool): Specify whether the search string must match the name of the target party exactly.. [optional] - party_role_array ([str, none_type]): The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.. [optional] - case_title (str, none_type): The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.. [optional] - case_office (int): The divisional office in which the case was filed.. [optional] - case_sequence_number (int): The PACER-assigned sequence number of the target case. Ex 12345. [optional] - case_year (int): The two- or four-digit year in which the target case was filed.. [optional] - case_type_array ([str, none_type]): The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr. [optional] - court_region_id_array ([str, none_type]): The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae. [optional] - case_year_from (int): Limit the results of the search to those cases from the year specified or later. [optional] - case_year_to (int): Limit the results of the search to those cases from the year specified or earlier. [optional] - case_filed_start_date (datetime, none_type): The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_filed_end_date (datetime, none_type): The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_start_date (datetime, none_type): The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - case_terminated_end_date (datetime, none_type): The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).. [optional] - sort_parameter_query (str, none_type): How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC. [optional] if omitted the server will use the default value of "lastName,ASC" - case_status (str, none_type): Whether the target case is marked as 'open' or 'closed' within PACER.. [optional] - page_number (int): The page number of the search results to be retrieved.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PCLParty - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + jpml_number: Annotated[Optional[StrictInt], Field(description="Master JPML Case Number.")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLParty]: + """PACER Case Locator Search API for All Courts. + + Search for the specified party in multidistrict litigation in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param jpml_number: Master JPML Case Number. + :type jpml_number: int + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._multi_district_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + jpml_number=jpml_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + + @validate_call + def multi_district_courts_pacer_case_locator_party_search_without_preload_content( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + jpml_number: Annotated[Optional[StrictInt], Field(description="Master JPML Case Number.")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PACER Case Locator Search API for All Courts. + + Search for the specified party in multidistrict litigation in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param jpml_number: Master JPML Case Number. + :type jpml_number: int + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._multi_district_courts_pacer_case_locator_party_search_serialize( + pacer_user_id=pacer_user_id, + pacer_client_code=pacer_client_code, + case_number=case_number, + jpml_number=jpml_number, + pacer_case_id=pacer_case_id, + last_name=last_name, + first_name=first_name, + middle_name=middle_name, + generation=generation, + party_type=party_type, + party_exact_name_match=party_exact_name_match, + party_role_array=party_role_array, + case_title=case_title, + case_office=case_office, + case_sequence_number=case_sequence_number, + case_year=case_year, + case_type_array=case_type_array, + court_region_id_array=court_region_id_array, + case_year_from=case_year_from, + case_year_to=case_year_to, + case_filed_start_date=case_filed_start_date, + case_filed_end_date=case_filed_end_date, + case_terminated_start_date=case_terminated_start_date, + case_terminated_end_date=case_terminated_end_date, + sort_parameter_query=sort_parameter_query, + case_status=case_status, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PCLParty", + '400': "Exception", + '424': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + return response_data.response + + + def _multi_district_courts_pacer_case_locator_party_search_serialize( + self, + pacer_user_id, + pacer_client_code, + case_number, + jpml_number, + pacer_case_id, + last_name, + first_name, + middle_name, + generation, + party_type, + party_exact_name_match, + party_role_array, + case_title, + case_office, + case_sequence_number, + case_year, + case_type_array, + court_region_id_array, + case_year_from, + case_year_to, + case_filed_start_date, + case_filed_end_date, + case_terminated_start_date, + case_terminated_end_date, + sort_parameter_query, + case_status, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'partyRoleArray': 'multi', + 'caseTypeArray': 'multi', + 'courtRegionIdArray': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pacer_user_id is not None: + + _query_params.append(('pacerUserId', pacer_user_id)) + + if pacer_client_code is not None: + + _query_params.append(('pacerClientCode', pacer_client_code)) + + if case_number is not None: + + _query_params.append(('caseNumber', case_number)) + + if jpml_number is not None: + + _query_params.append(('jpmlNumber', jpml_number)) + + if pacer_case_id is not None: + + _query_params.append(('pacerCaseId', pacer_case_id)) + + if last_name is not None: + + _query_params.append(('lastName', last_name)) + + if first_name is not None: + + _query_params.append(('firstName', first_name)) + + if middle_name is not None: + + _query_params.append(('middleName', middle_name)) + + if generation is not None: + + _query_params.append(('generation', generation)) + + if party_type is not None: + + _query_params.append(('partyType', party_type)) + + if party_exact_name_match is not None: + + _query_params.append(('partyExactNameMatch', party_exact_name_match)) + + if party_role_array is not None: + + _query_params.append(('partyRoleArray', party_role_array)) + + if case_title is not None: + + _query_params.append(('caseTitle', case_title)) + + if case_office is not None: + + _query_params.append(('caseOffice', case_office)) + + if case_sequence_number is not None: + + _query_params.append(('caseSequenceNumber', case_sequence_number)) + + if case_year is not None: + + _query_params.append(('caseYear', case_year)) + + if case_type_array is not None: + + _query_params.append(('caseTypeArray', case_type_array)) + + if court_region_id_array is not None: + + _query_params.append(('courtRegionIdArray', court_region_id_array)) + + if case_year_from is not None: + + _query_params.append(('caseYearFrom', case_year_from)) + + if case_year_to is not None: + + _query_params.append(('caseYearTo', case_year_to)) + + if case_filed_start_date is not None: + if isinstance(case_filed_start_date, datetime): + _query_params.append( + ( + 'caseFiledStartDate', + case_filed_start_date + ) + ) + else: + _query_params.append(('caseFiledStartDate', case_filed_start_date)) + + if case_filed_end_date is not None: + if isinstance(case_filed_end_date, datetime): + _query_params.append( + ( + 'caseFiledEndDate', + case_filed_end_date + ) + ) + else: + _query_params.append(('caseFiledEndDate', case_filed_end_date)) + + if case_terminated_start_date is not None: + if isinstance(case_terminated_start_date, datetime): + _query_params.append( + ( + 'caseTerminatedStartDate', + case_terminated_start_date + ) + ) + else: + _query_params.append(('caseTerminatedStartDate', case_terminated_start_date)) + + if case_terminated_end_date is not None: + if isinstance(case_terminated_end_date, datetime): + _query_params.append( + ( + 'caseTerminatedEndDate', + case_terminated_end_date + ) + ) + else: + _query_params.append(('caseTerminatedEndDate', case_terminated_end_date)) + + if sort_parameter_query is not None: + + _query_params.append(('sortParameterQuery', sort_parameter_query)) + + if case_status is not None: + + _query_params.append(('caseStatus', case_status)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacerCaseLocator/partySearch/multiDistrictCourts', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - kwargs['pacer_client_code'] = \ - pacer_client_code - return self.multi_district_courts_pacer_case_locator_party_search_endpoint.call_with_http_info(**kwargs) + diff --git a/unicourt/api/pacer_credential_api.py b/unicourt/api/pacer_credential_api.py index 1d8a003..a02833d 100644 --- a/unicourt/api/pacer_credential_api.py +++ b/unicourt/api/pacer_credential_api.py @@ -1,582 +1,1101 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from unicourt.model.exception import Exception +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated from unicourt.model.pacer_credential import PacerCredential from unicourt.model.pacer_credential_list_response import PacerCredentialListResponse from unicourt.model.pacer_credential_request import PacerCredentialRequest from unicourt.model.success import Success +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType + -class PACERCredentialApi(object): +class PACERCredentialApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.add_pacer_credential_endpoint = _Endpoint( - settings={ - 'response_type': (Success,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCredential', - 'operation_id': 'add_pacer_credential', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_credential_request', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pacer_credential_request': - (PacerCredentialRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'pacer_credential_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.get_pacer_credential_endpoint = _Endpoint( - settings={ - 'response_type': (PacerCredentialListResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCredential', - 'operation_id': 'get_pacer_credential', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'page_number', - ] - }, - root_map={ - 'validations': { - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'page_number': - (int,), - }, - 'attribute_map': { - 'page_number': 'pageNumber', - }, - 'location_map': { - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_pacer_credential_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (PacerCredential,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCredential/{pacerUserId}', - 'operation_id': 'get_pacer_credential_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - ], - 'required': [ - 'pacer_user_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'pacer_user_id', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 40, - 'min_length': 6, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - }, - 'location_map': { - 'pacer_user_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.remove_pacer_credential_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (Success,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/pacerCredential/{pacerUserId}', - 'operation_id': 'remove_pacer_credential_by_id', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'pacer_user_id', - ], - 'required': [ - 'pacer_user_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'pacer_user_id', - ] - }, - root_map={ - 'validations': { - ('pacer_user_id',): { - 'max_length': 40, - 'min_length': 6, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pacer_user_id': - (str,), - }, - 'attribute_map': { - 'pacer_user_id': 'pacerUserId', - }, - 'location_map': { - 'pacer_user_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def add_pacer_credential( self, - **kwargs - ): - """Add Pacer Credential. # noqa: E501 - - Register PACER credentials with UniCourt. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_pacer_credential(async_req=True) - >>> result = thread.get() - - - Keyword Args: - pacer_credential_request (PacerCredentialRequest): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Success - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.add_pacer_credential_endpoint.call_with_http_info(**kwargs) + pacer_credential_request: Optional[PacerCredentialRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Success: + """Add Pacer Credential. + + Register PACER credentials with UniCourt. + + :param pacer_credential_request: + :type pacer_credential_request: PacerCredentialRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_pacer_credential_serialize( + pacer_credential_request=pacer_credential_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_pacer_credential_with_http_info( + self, + pacer_credential_request: Optional[PacerCredentialRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Success]: + """Add Pacer Credential. + + Register PACER credentials with UniCourt. + + :param pacer_credential_request: + :type pacer_credential_request: PacerCredentialRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_pacer_credential_serialize( + pacer_credential_request=pacer_credential_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def add_pacer_credential_without_preload_content( + self, + pacer_credential_request: Optional[PacerCredentialRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add Pacer Credential. + + Register PACER credentials with UniCourt. + + :param pacer_credential_request: + :type pacer_credential_request: PacerCredentialRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_pacer_credential_serialize( + pacer_credential_request=pacer_credential_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_pacer_credential_serialize( + self, + pacer_credential_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if pacer_credential_request is not None: + _body_params = pacer_credential_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + return self.api_client.param_serialize( + method='PUT', + resource_path='/pacerCredential', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_pacer_credential( self, - **kwargs - ): - """Get Pacer Credential List. # noqa: E501 - - List registered PACER credentials. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pacer_credential(async_req=True) - >>> result = thread.get() - - - Keyword Args: - page_number (int): The page number of the PACER credentials to be retrieved.
- Minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PacerCredentialListResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_pacer_credential_endpoint.call_with_http_info(**kwargs) + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the PACER credentials to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PacerCredentialListResponse: + """Get Pacer Credential List. + + List registered PACER credentials. + + :param page_number: The page number of the PACER credentials to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pacer_credential_serialize( + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PacerCredentialListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_pacer_credential_with_http_info( + self, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the PACER credentials to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PacerCredentialListResponse]: + """Get Pacer Credential List. + + List registered PACER credentials. + + :param page_number: The page number of the PACER credentials to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pacer_credential_serialize( + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PacerCredentialListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_pacer_credential_without_preload_content( + self, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the PACER credentials to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Pacer Credential List. + + List registered PACER credentials. + + :param page_number: The page number of the PACER credentials to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pacer_credential_serialize( + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PacerCredentialListResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_pacer_credential_serialize( + self, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacerCredential', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_pacer_credential_by_id( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40, description="The PACER username for which PACER credentials are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PacerCredential: + """Get Pacer Credential for a requested pacer User Id. + + Retrieve the PACER credentials for the specified PACER username. + + :param pacer_user_id: The PACER username for which PACER credentials are to be retrieved. (required) + :type pacer_user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pacer_credential_by_id_serialize( + pacer_user_id=pacer_user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PacerCredential", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_pacer_credential_by_id_with_http_info( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40, description="The PACER username for which PACER credentials are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PacerCredential]: + """Get Pacer Credential for a requested pacer User Id. + + Retrieve the PACER credentials for the specified PACER username. + + :param pacer_user_id: The PACER username for which PACER credentials are to be retrieved. (required) + :type pacer_user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pacer_credential_by_id_serialize( + pacer_user_id=pacer_user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PacerCredential", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_pacer_credential_by_id_without_preload_content( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40, description="The PACER username for which PACER credentials are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Pacer Credential for a requested pacer User Id. + + Retrieve the PACER credentials for the specified PACER username. + + :param pacer_user_id: The PACER username for which PACER credentials are to be retrieved. (required) + :type pacer_user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pacer_credential_by_id_serialize( + pacer_user_id=pacer_user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PacerCredential", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_pacer_credential_by_id_serialize( self, pacer_user_id, - **kwargs - ): - """Get Pacer Credential for a requested pacer User Id. # noqa: E501 - - Retrieve the PACER credentials for the specified PACER username. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_pacer_credential_by_id(pacer_user_id, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The PACER username for which PACER credentials are to be retrieved. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PacerCredential - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - return self.get_pacer_credential_by_id_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pacer_user_id is not None: + _path_params['pacerUserId'] = pacer_user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pacerCredential/{pacerUserId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def remove_pacer_credential_by_id( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40, description="The PACER username for which PACER credentials are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Success: + """Remove Pacer credential for a specific Pacer User Id. + + De-register the PACER credentials for the specified PACER username. + + :param pacer_user_id: The PACER username for which PACER credentials are to be retrieved. (required) + :type pacer_user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_pacer_credential_by_id_serialize( + pacer_user_id=pacer_user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def remove_pacer_credential_by_id_with_http_info( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40, description="The PACER username for which PACER credentials are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Success]: + """Remove Pacer credential for a specific Pacer User Id. + + De-register the PACER credentials for the specified PACER username. + + :param pacer_user_id: The PACER username for which PACER credentials are to be retrieved. (required) + :type pacer_user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_pacer_credential_by_id_serialize( + pacer_user_id=pacer_user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def remove_pacer_credential_by_id_without_preload_content( + self, + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40, description="The PACER username for which PACER credentials are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove Pacer credential for a specific Pacer User Id. + + De-register the PACER credentials for the specified PACER username. + + :param pacer_user_id: The PACER username for which PACER credentials are to be retrieved. (required) + :type pacer_user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_pacer_credential_by_id_serialize( + pacer_user_id=pacer_user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Success", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_pacer_credential_by_id_serialize( self, pacer_user_id, - **kwargs - ): - """Remove Pacer credential for a specific Pacer User Id. # noqa: E501 - - De-register the PACER credentials for the specified PACER username. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.remove_pacer_credential_by_id(pacer_user_id, async_req=True) - >>> result = thread.get() - - Args: - pacer_user_id (str): The PACER username for which PACER credentials are to be retrieved. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - Success - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['pacer_user_id'] = \ - pacer_user_id - return self.remove_pacer_credential_by_id_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pacer_user_id is not None: + _path_params['pacerUserId'] = pacer_user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/pacerCredential/{pacerUserId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + diff --git a/unicourt/api/party_analytics_api.py b/unicourt/api/party_analytics_api.py index 7224eda..5418c9e 100644 --- a/unicourt/api/party_analytics_api.py +++ b/unicourt/api/party_analytics_api.py @@ -1,958 +1,1759 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated from unicourt.model.associated_norm_attorney_response import AssociatedNormAttorneyResponse from unicourt.model.associated_norm_judge_response import AssociatedNormJudgeResponse from unicourt.model.associated_norm_law_firm_response import AssociatedNormLawFirmResponse -from unicourt.model.exception import Exception from unicourt.model.norm_party import NormParty from unicourt.model.norm_party_search_response import NormPartySearchResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType + -class PartyAnalyticsApi(object): +class PartyAnalyticsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_norm_attorneys_associated_with_norm_party_endpoint = _Endpoint( - settings={ - 'response_type': (AssociatedNormAttorneyResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normParty/{normPartyId}/associatedNormAttorneys', - 'operation_id': 'get_norm_attorneys_associated_with_norm_party', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_party_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_party_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_party_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_party_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_party_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_party_id': 'normPartyId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_party_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_norm_judges_associated_with_norm_party_endpoint = _Endpoint( - settings={ - 'response_type': (AssociatedNormJudgeResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normParty/{normPartyId}/associatedNormJudges', - 'operation_id': 'get_norm_judges_associated_with_norm_party', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_party_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_party_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_party_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_party_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_party_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_party_id': 'normPartyId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_party_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_norm_law_firms_associated_with_norm_party_endpoint = _Endpoint( - settings={ - 'response_type': (AssociatedNormLawFirmResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normParty/{normPartyId}/associatedNormLawFirms', - 'operation_id': 'get_norm_law_firms_associated_with_norm_party', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_party_id', - 'q', - 'page_number', - ], - 'required': [ - 'norm_party_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_party_id', - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_party_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('q',): { - 'max_length': 2048, - }, - ('page_number',): { - - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_party_id': - (str,), - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_party_id': 'normPartyId', - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_party_id': 'path', - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_norm_party_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (NormParty,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normParty/{normPartyId}', - 'operation_id': 'get_norm_party_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_party_id', - ], - 'required': [ - 'norm_party_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_party_id', - ] - }, - root_map={ - 'validations': { - ('norm_party_id',): { - 'max_length': 18, - 'min_length': 18, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_party_id': - (str,), - }, - 'attribute_map': { - 'norm_party_id': 'normPartyId', - }, - 'location_map': { - 'norm_party_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.search_normalized_parties_endpoint = _Endpoint( - settings={ - 'response_type': (NormPartySearchResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normPartySearch', - 'operation_id': 'search_normalized_parties', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'q', - 'page_number', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'q', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('q',): { - 'max_length': 2000, - 'min_length': 3, - }, - ('page_number',): { - - 'inclusive_maximum': 1000, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'q': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'q': 'q', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'q': 'query', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.search_normalized_parties_by_id_endpoint = _Endpoint( - settings={ - 'response_type': (NormPartySearchResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/normPartySearch/{normPartySearchId}', - 'operation_id': 'search_normalized_parties_by_id', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'norm_party_search_id', - 'page_number', - ], - 'required': [ - 'norm_party_search_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'norm_party_search_id', - 'page_number', - ] - }, - root_map={ - 'validations': { - ('norm_party_search_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('page_number',): { - - 'inclusive_maximum': 1000, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'norm_party_search_id': - (str,), - 'page_number': - (int,), - }, - 'attribute_map': { - 'norm_party_search_id': 'normPartySearchId', - 'page_number': 'pageNumber', - }, - 'location_map': { - 'norm_party_search_id': 'path', - 'page_number': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def get_norm_attorneys_associated_with_norm_party( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyID value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssociatedNormAttorneyResponse: + """Attorneys that represented the Party. + + Search for attorneys who have represented a given party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_party_id: The normPartyID value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_attorneys_associated_with_norm_party_serialize( + norm_party_id=norm_party_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_attorneys_associated_with_norm_party_with_http_info( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyID value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormAttorneyResponse]: + """Attorneys that represented the Party. + + Search for attorneys who have represented a given party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_party_id: The normPartyID value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_attorneys_associated_with_norm_party_serialize( + norm_party_id=norm_party_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_attorneys_associated_with_norm_party_without_preload_content( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyID value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Attorneys that represented the Party. + + Search for attorneys who have represented a given party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_party_id: The normPartyID value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_attorneys_associated_with_norm_party_serialize( + norm_party_id=norm_party_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormAttorneyResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_attorneys_associated_with_norm_party_serialize( self, norm_party_id, - **kwargs - ): - """Attorneys that represented the Party. # noqa: E501 - - Search for attorneys who have represented a given party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

# noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_attorneys_associated_with_norm_party(norm_party_id, async_req=True) - >>> result = thread.get() - - Args: - norm_party_id (str): The normPartyID value of the desired party. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The keyword expression targeting the desired attorneys.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AssociatedNormAttorneyResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_party_id'] = \ - norm_party_id - return self.get_norm_attorneys_associated_with_norm_party_endpoint.call_with_http_info(**kwargs) + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_party_id is not None: + _path_params['normPartyId'] = norm_party_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normParty/{normPartyId}/associatedNormAttorneys', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_norm_judges_associated_with_norm_party( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssociatedNormJudgeResponse: + """Judges Faced By the Party. + + Search for judges before whom a party has appeared using a keyword expression.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_judges_associated_with_norm_party_serialize( + norm_party_id=norm_party_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormJudgeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_judges_associated_with_norm_party_with_http_info( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormJudgeResponse]: + """Judges Faced By the Party. + + Search for judges before whom a party has appeared using a keyword expression.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_judges_associated_with_norm_party_serialize( + norm_party_id=norm_party_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormJudgeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_judges_associated_with_norm_party_without_preload_content( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Judges Faced By the Party. + + Search for judges before whom a party has appeared using a keyword expression.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_judges_associated_with_norm_party_serialize( + norm_party_id=norm_party_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormJudgeResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_judges_associated_with_norm_party_serialize( self, norm_party_id, - **kwargs - ): - """Judges Faced By the Party. # noqa: E501 - - Search for judges before whom a party has appeared using a keyword expression.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

# noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_judges_associated_with_norm_party(norm_party_id, async_req=True) - >>> result = thread.get() - - Args: - norm_party_id (str): The normPartyId value of the desired party. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AssociatedNormJudgeResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_party_id'] = \ - norm_party_id - return self.get_norm_judges_associated_with_norm_party_endpoint.call_with_http_info(**kwargs) + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_party_id is not None: + _path_params['normPartyId'] = norm_party_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normParty/{normPartyId}/associatedNormJudges', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def get_norm_law_firms_associated_with_norm_party( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired law firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssociatedNormLawFirmResponse: + """Law Firms that represented the Party. + + Search for law firms that have represented the specified party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all lawfirms associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_law_firms_associated_with_norm_party_serialize( + norm_party_id=norm_party_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_law_firms_associated_with_norm_party_with_http_info( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired law firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormLawFirmResponse]: + """Law Firms that represented the Party. + + Search for law firms that have represented the specified party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all lawfirms associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_law_firms_associated_with_norm_party_serialize( + norm_party_id=norm_party_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_law_firms_associated_with_norm_party_without_preload_content( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired law firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Law Firms that represented the Party. + + Search for law firms that have represented the specified party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all lawfirms associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_law_firms_associated_with_norm_party_serialize( + norm_party_id=norm_party_id, + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssociatedNormLawFirmResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_law_firms_associated_with_norm_party_serialize( self, norm_party_id, - **kwargs - ): - """Law Firms that represented the Party. # noqa: E501 - - Search for law firms that have represented the specified party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all lawfirms associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_law_firms_associated_with_norm_party(norm_party_id, async_req=True) - >>> result = thread.get() - - Args: - norm_party_id (str): The normPartyId value of the desired party. - minimum: 18 - maximum: 18 - - Keyword Args: - q (str): The keyword expression targeting the desired law firms.. [optional] - page_number (int): The page number of the desired page of results. - minimum: 1 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AssociatedNormLawFirmResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_party_id'] = \ - norm_party_id - return self.get_norm_law_firms_associated_with_norm_party_endpoint.call_with_http_info(**kwargs) + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_party_id is not None: + _path_params['normPartyId'] = norm_party_id + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normParty/{normPartyId}/associatedNormLawFirms', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_norm_party_by_id( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NormParty: + """Norm Party Details. + + Retrieve the specified party. + + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_party_by_id_serialize( + norm_party_id=norm_party_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormParty", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_norm_party_by_id_with_http_info( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormParty]: + """Norm Party Details. + + Retrieve the specified party. + + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_party_by_id_serialize( + norm_party_id=norm_party_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormParty", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_norm_party_by_id_without_preload_content( + self, + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Norm Party Details. + + Retrieve the specified party. + + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_norm_party_by_id_serialize( + norm_party_id=norm_party_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormParty", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_norm_party_by_id_serialize( self, norm_party_id, - **kwargs - ): - """Norm Party Details. # noqa: E501 - - Retrieve the specified party. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_norm_party_by_id(norm_party_id, async_req=True) - >>> result = thread.get() - - Args: - norm_party_id (str): The normPartyId value of the desired party. - minimum: 18 - maximum: 18 - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NormParty - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_party_id'] = \ - norm_party_id - return self.get_norm_party_by_id_endpoint.call_with_http_info(**kwargs) + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_party_id is not None: + _path_params['normPartyId'] = norm_party_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normParty/{normPartyId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def search_normalized_parties( self, - **kwargs - ): - """Party search. # noqa: E501 - - ### Search for a party using a keyword expression. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.search_normalized_parties(async_req=True) - >>> result = thread.get() - - - Keyword Args: - q (str): The keyword expression targeting the desired party. . [optional] - page_number (int): The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NormPartySearchResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.search_normalized_parties_endpoint.call_with_http_info(**kwargs) + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NormPartySearchResponse: + """Party search. + + ### Search for a party using a keyword expression. + + :param q: The keyword expression targeting the desired party. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_parties_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormPartySearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def search_normalized_parties_with_http_info( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormPartySearchResponse]: + """Party search. + + ### Search for a party using a keyword expression. + + :param q: The keyword expression targeting the desired party. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_parties_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormPartySearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def search_normalized_parties_without_preload_content( + self, + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Party search. + + ### Search for a party using a keyword expression. + + :param q: The keyword expression targeting the desired party. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_parties_serialize( + q=q, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormPartySearchResponse", + '400': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _search_normalized_parties_serialize( + self, + q, + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if q is not None: + + _query_params.append(('q', q)) + + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normPartySearch', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def search_normalized_parties_by_id( + self, + norm_party_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartySearchId value of the search to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NormPartySearchResponse: + """Norm party search results for a given normPartySearchId. + + ### Retrieve a search for a party. + + :param norm_party_search_id: The normPartySearchId value of the search to be retrieved. (required) + :type norm_party_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_parties_by_id_serialize( + norm_party_search_id=norm_party_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormPartySearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def search_normalized_parties_by_id_with_http_info( + self, + norm_party_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartySearchId value of the search to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormPartySearchResponse]: + """Norm party search results for a given normPartySearchId. + + ### Retrieve a search for a party. + + :param norm_party_search_id: The normPartySearchId value of the search to be retrieved. (required) + :type norm_party_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_parties_by_id_serialize( + norm_party_search_id=norm_party_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormPartySearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def search_normalized_parties_by_id_without_preload_content( + self, + norm_party_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartySearchId value of the search to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Norm party search results for a given normPartySearchId. + + ### Retrieve a search for a party. + + :param norm_party_search_id: The normPartySearchId value of the search to be retrieved. (required) + :type norm_party_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_normalized_parties_by_id_serialize( + norm_party_search_id=norm_party_search_id, + page_number=page_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NormPartySearchResponse", + '400': "Exception", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _search_normalized_parties_by_id_serialize( self, norm_party_search_id, - **kwargs - ): - """Norm party search results for a given normPartySearchId. # noqa: E501 - - ### Retrieve a search for a party. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.search_normalized_parties_by_id(norm_party_search_id, async_req=True) - >>> result = thread.get() - - Args: - norm_party_search_id (str): The normPartySearchId value of the search to be retrieved. - - Keyword Args: - page_number (int): The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 . [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - NormPartySearchResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['norm_party_search_id'] = \ - norm_party_search_id - return self.search_normalized_parties_by_id_endpoint.call_with_http_info(**kwargs) + page_number, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if norm_party_search_id is not None: + _path_params['normPartySearchId'] = norm_party_search_id + # process the query parameters + if page_number is not None: + + _query_params.append(('pageNumber', page_number)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/normPartySearch/{normPartySearchId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + diff --git a/unicourt/api/usage_api.py b/unicourt/api/usage_api.py index 7a14e9f..c75004a 100644 --- a/unicourt/api/usage_api.py +++ b/unicourt/api/usage_api.py @@ -1,441 +1,806 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from unicourt.api_client import ApiClient, Endpoint as _Endpoint -from unicourt.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) +from datetime import date +from pydantic import Field +from typing_extensions import Annotated from unicourt.model.billing_cycle_usage_response import BillingCycleUsageResponse from unicourt.model.billing_cycles_response import BillingCyclesResponse from unicourt.model.daily_usage_response import DailyUsageResponse -from unicourt.model.exception import Exception + +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType -class UsageApi(object): +class UsageApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.get_billing_cycles_endpoint = _Endpoint( - settings={ - 'response_type': (BillingCyclesResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/billingCycles', - 'operation_id': 'get_billing_cycles', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_billing_usage_by_billing_cycle_endpoint = _Endpoint( - settings={ - 'response_type': (BillingCycleUsageResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/billingCycleUsage/{billingCycle}', - 'operation_id': 'get_billing_usage_by_billing_cycle', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'billing_cycle', - ], - 'required': [ - 'billing_cycle', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'billing_cycle', - ] - }, - root_map={ - 'validations': { - ('billing_cycle',): { - 'max_length': 22, - 'min_length': 22, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'billing_cycle': - (str,), - }, - 'attribute_map': { - 'billing_cycle': 'billingCycle', - }, - 'location_map': { - 'billing_cycle': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + + @validate_call + def get_billing_cycles( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BillingCyclesResponse: + """Get all the previous 12 billing cycles. + + An endpoint to obtain information on the previous 12 billing cycles. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_billing_cycles_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.get_daily_usage_by_date_endpoint = _Endpoint( - settings={ - 'response_type': (DailyUsageResponse,), - 'auth': [ - 'bearerAuth' - ], - 'endpoint_path': '/dailyUsage/{date}', - 'operation_id': 'get_daily_usage_by_date', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'date', - ], - 'required': [ - 'date', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'date', - ] - }, - root_map={ - 'validations': { - ('date',): { - 'max_length': 10, - 'min_length': 10, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'date': - (date,), - }, - 'attribute_map': { - 'date': 'date', - }, - 'location_map': { - 'date': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BillingCyclesResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data - def get_billing_cycles( + + @validate_call + def get_billing_cycles_with_http_info( self, - **kwargs - ): - """Get all the previous 12 billing cycles. # noqa: E501 - - An endpoint to obtain information on the previous 12 billing cycles. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_billing_cycles(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - BillingCyclesResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BillingCyclesResponse]: + """Get all the previous 12 billing cycles. + + An endpoint to obtain information on the previous 12 billing cycles. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_billing_cycles_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BillingCyclesResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + + @validate_call + def get_billing_cycles_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get all the previous 12 billing cycles. + + An endpoint to obtain information on the previous 12 billing cycles. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_billing_cycles_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BillingCyclesResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + return response_data.response + + + def _get_billing_cycles_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/billingCycles', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - return self.get_billing_cycles_endpoint.call_with_http_info(**kwargs) + + + + @validate_call def get_billing_usage_by_billing_cycle( self, - billing_cycle, - **kwargs - ): - """Specify the billing cycle to know the API usage. # noqa: E501 - - An endpoint to obtain information on API usage for a specific billing cycle. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_billing_usage_by_billing_cycle(billing_cycle, async_req=True) - >>> result = thread.get() - - Args: - billing_cycle (str): The date obtainable from the /billingCycles endpoint which is used as an identifier for the specific billing cycle you wish to obtain information on. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - BillingCycleUsageResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + billing_cycle: Annotated[str, Field(min_length=22, strict=True, max_length=22, description="The date obtainable from the /billingCycles endpoint which is used as an identifier for the specific billing cycle you wish to obtain information on.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BillingCycleUsageResponse: + """Specify the billing cycle to know the API usage. + + An endpoint to obtain information on API usage for a specific billing cycle. + + :param billing_cycle: The date obtainable from the /billingCycles endpoint which is used as an identifier for the specific billing cycle you wish to obtain information on. (required) + :type billing_cycle: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_billing_usage_by_billing_cycle_serialize( + billing_cycle=billing_cycle, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BillingCycleUsageResponse", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_billing_usage_by_billing_cycle_with_http_info( + self, + billing_cycle: Annotated[str, Field(min_length=22, strict=True, max_length=22, description="The date obtainable from the /billingCycles endpoint which is used as an identifier for the specific billing cycle you wish to obtain information on.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BillingCycleUsageResponse]: + """Specify the billing cycle to know the API usage. + + An endpoint to obtain information on API usage for a specific billing cycle. + + :param billing_cycle: The date obtainable from the /billingCycles endpoint which is used as an identifier for the specific billing cycle you wish to obtain information on. (required) + :type billing_cycle: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_billing_usage_by_billing_cycle_serialize( + billing_cycle=billing_cycle, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BillingCycleUsageResponse", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def get_billing_usage_by_billing_cycle_without_preload_content( + self, + billing_cycle: Annotated[str, Field(min_length=22, strict=True, max_length=22, description="The date obtainable from the /billingCycles endpoint which is used as an identifier for the specific billing cycle you wish to obtain information on.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Specify the billing cycle to know the API usage. + + An endpoint to obtain information on API usage for a specific billing cycle. + + :param billing_cycle: The date obtainable from the /billingCycles endpoint which is used as an identifier for the specific billing cycle you wish to obtain information on. (required) + :type billing_cycle: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_billing_usage_by_billing_cycle_serialize( + billing_cycle=billing_cycle, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BillingCycleUsageResponse", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_billing_usage_by_billing_cycle_serialize( + self, + billing_cycle, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if billing_cycle is not None: + _path_params['billingCycle'] = billing_cycle + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/billingCycleUsage/{billingCycle}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['billing_cycle'] = \ - billing_cycle - return self.get_billing_usage_by_billing_cycle_endpoint.call_with_http_info(**kwargs) + + + + @validate_call def get_daily_usage_by_date( self, - date, - **kwargs - ): - """Get API usage for a requested Date. # noqa: E501 - - An endpoint to obtain information on API usage for a specific day. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_daily_usage_by_date(date, async_req=True) - >>> result = thread.get() - - Args: - date (date): The specific date for which you wish to obtain information on API usage. - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): timeout setting for this request. If - one number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - DailyUsageResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + date: Annotated[date, Field(description="The specific date for which you wish to obtain information on API usage.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DailyUsageResponse: + """Get API usage for a requested Date. + + An endpoint to obtain information on API usage for a specific day. + + :param date: The specific date for which you wish to obtain information on API usage. (required) + :type date: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_daily_usage_by_date_serialize( + date=date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DailyUsageResponse", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_daily_usage_by_date_with_http_info( + self, + date: Annotated[date, Field(description="The specific date for which you wish to obtain information on API usage.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DailyUsageResponse]: + """Get API usage for a requested Date. + + An endpoint to obtain information on API usage for a specific day. + + :param date: The specific date for which you wish to obtain information on API usage. (required) + :type date: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_daily_usage_by_date_serialize( + date=date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DailyUsageResponse", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + + @validate_call + def get_daily_usage_by_date_without_preload_content( + self, + date: Annotated[date, Field(description="The specific date for which you wish to obtain information on API usage.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get API usage for a requested Date. + + An endpoint to obtain information on API usage for a specific day. + + :param date: The specific date for which you wish to obtain information on API usage. (required) + :type date: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_daily_usage_by_date_serialize( + date=date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DailyUsageResponse", + '404': "Exception", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + return response_data.response + + + def _get_daily_usage_by_date_serialize( + self, + date, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if date is not None: + _path_params['date'] = date + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/dailyUsage/{date}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['date'] = \ - date - return self.get_daily_usage_by_date_endpoint.call_with_http_info(**kwargs) + diff --git a/unicourt/api_client.py b/unicourt/api_client.py old mode 100755 new mode 100644 index 6792578..68b8168 --- a/unicourt/api_client.py +++ b/unicourt/api_client.py @@ -1,44 +1,48 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import datetime +from dateutil.parser import parse +from enum import Enum import json -import atexit import mimetypes -from multiprocessing.pool import ThreadPool -import io import os import re -import typing -from urllib.parse import quote -from urllib3.fields import RequestField +import tempfile +from unicourt import constants +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr -from unicourt import rest from unicourt.configuration import Configuration -from unicourt.exceptions import ApiTypeError, ApiValueError, ApiException, SdkException -from unicourt.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types +from unicourt.api_response import ApiResponse, T as ApiResponseT +import unicourt.model +from unicourt import rest +from unicourt.exceptions import ( + ApiValueError, + SdkException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException ) +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] -class ApiClient(object): +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -46,28 +50,38 @@ class ApiClient(object): the methods and models for each application are generated from the OpenAPI templates. - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to the API. :param cookie: a cookie to include in the header when making calls to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. """ + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided if configuration is None: - configuration = Configuration.get_default_copy() + configuration = Configuration.get_default() self.configuration = configuration - self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} @@ -75,31 +89,14 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0/python' + self.user_agent = 'UniCourt/SDK/' + constants.RELEASE_VERSION + self.client_side_validation = configuration.client_side_validation def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool + pass @property def user_agent(self): @@ -113,27 +110,69 @@ def user_agent(self, value): def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value - def __call_api( + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ config = self.configuration @@ -143,15 +182,18 @@ def __call_api( if self.cookie: header_params['Cookie'] = self.cookie if header_params: - header_params = self.sanitize_for_serialization(header_params, method=method) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) # path parameters if path_params: - path_params = self.sanitize_for_serialization(path_params, method=method) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( @@ -159,31 +201,31 @@ def __call_api( quote(str(v), safe=config.safe_chars_for_path_param) ) - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params, method=method) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - # post parameters if post_params or files: post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params, method=method) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict)) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) # body if body: - body = self.sanitize_for_serialization(body, method=method) - - # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body, - request_auths=_request_auths) + body = self.sanitize_for_serialization(body) # request url if _host is None: @@ -192,323 +234,220 @@ def __call_api( # use server/host defined in path or operation instead url = _host + resource_path + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + try: # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + response_data = self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + except SdkException as e: - e.body = e.body.decode('utf-8') raise e - self.last_response = response_data + return response_data - return_data = response_data + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ - if not _preload_content: - return (return_data) - return return_data + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) # deserialize response data - if response_type: - if response_type != (file_type,): - encoding = "utf-8" + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None content_type = response_data.getheader('content-type') if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None - - # The SDK generation for GET method has boolean value issue - # Refer : https://github.com/OpenAPITools/openapi-generator/issues/1260 - # [APIT-79] https://unicourt.atlassian.net/browse/APIT-79 - if _return_http_data_only: - # return (return_data) - return return_data, response_data.status - else: - # return (return_data, response_data.status, - # response_data.getheaders()) - return return_data, response_data.status + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + if response_type in ["bytearray", "str"]: + return_data = self.__deserialize_primitive(response_text, response_type) + else: + return_data = self.deserialize(response_text, response_type) + finally: + if not 200 <= response_data.status <= 299: + raise SdkException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance( - v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. - # The SDK generation for GET method has boolean value issue - # Refer : https://github.com/OpenAPITools/openapi-generator/issues/1260 - # [APIT-79] https://unicourt.atlassian.net/browse/APIT-79 - # To fix this issue there is a addition of parameter `method` for function `sanitize_for_serialization` - @classmethod - def sanitize_for_serialization(cls, obj, method=None): - """Prepares data for transmission before it is sent with the rest client If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes + :param obj: The data to serialize. :return: The serialized form of data. """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, - val in model_to_dict( - obj, - serialize=True).items()} - elif isinstance(obj, bool) and method == "GET": - return obj.__str__().lower() - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): return obj - elif isinstance(obj, (datetime, date)): + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() - elif isinstance(obj, ModelSimple): - return cls.sanitize_for_serialization(obj.value, method=method) - elif isinstance(obj, (list, tuple)): - return [cls.sanitize_for_serialization(item, method=method) for item in obj] - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val, method=method) for key, val in obj.items()} - raise ApiValueError( - 'Unable to prepare type {} for serialization'.format( - obj.__class__.__name__)) - - def deserialize(self, response, response_type, _check_type): + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text, response_type): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool + :param response_type: class literal for + deserialized object, or string of class name. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) # fetch data from response object try: - received_data = json.loads(response.data) + data = json.loads(response_text) except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration - ) - return deserialized_data + data = response_text - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. + return self.__deserialize(data, response_type) - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute request asynchronously - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :param _request_auths: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auths: list, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type, _request_auths=_request_auths) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type, None, _request_auths)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(unicourt.model, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) + return self.__deserialize_model(data, klass) def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -517,10 +456,10 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -540,118 +479,169 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def files_parameters(self, - files: typing.Optional[typing.Dict[str, - typing.List[io.IOBase]]] = None): - """Builds form parameters. + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) """ - if files is None: - return [] + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) + else: + new_params.append((k, quote(str(v)))) + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters(self, files: Dict[str, Union[str, bytes]]): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params - def select_header_accept(self, accepts): + def select_header_accept(self, accepts: List[str]) -> Optional[str]: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return + return None - accepts = [x.lower() for x in accepts] + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) + return accepts[0] - def select_header_content_type(self, content_types, method=None, body=None): + def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: return None - content_types = [x.lower() for x in content_types] - - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] + return content_types[0] - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auths=None): + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param queries: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - :param request_auths: if set, the provided settings will - override the token in the configuration. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return - if request_auths: - for auth_setting in request_auths: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) - return + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting - def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['key'] + "=" + auth_setting['value'] + headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': headers[auth_setting['key']] = auth_setting['value'] @@ -662,245 +652,120 @@ def _apply_auth_params(self, headers, queries, resource_path, method, body, auth 'Authentication token must be in `query` or `header`' ) + def __deserialize_file(self, response): + """Deserializes body to file -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type', - '_content_type', - '_spec_property_naming', - '_request_auths' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,), - '_spec_property_naming': (bool,), - '_content_type': (none_type, str), - '_request_auths': (none_type, list) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) - - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration - ) + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. - if kwargs['_check_input_type'] is False: - return + handle file downloading + save response body into a tmp file and return the instance - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs['_spec_property_naming'], - kwargs['_check_input_type'], - configuration=self.api_client.configuration + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][base_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][base_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format + with open(path, "wb") as f: + f.write(response.data) - return params + return path - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. - api_instance = AttorneyAnalyticsApi() - api_instance.get_norm_attorney_by_id # this is an instance of the class Endpoint - api_instance.get_norm_attorney_by_id() # this invokes api_instance.get_norm_attorney_by_id.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.get_norm_attorney_by_id.callable or self.callable in this class + :param data: str. + :param klass: class literal. + :return: int, long, float, str, bool. """ - return self.callable(self, *args, **kwargs) + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value - def call_with_http_info(self, **kwargs): + def __deserialize_date(self, string): + """Deserializes string to date. + :param string: str. + :return: date. + """ try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.SdkException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) ) - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.SdkException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. - self.__validate_inputs(kwargs) + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.SdkException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) - params = self.__gather_params(kwargs) + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ - if kwargs.get('_content_type'): - params['header']['Content-Type'] = kwargs['_content_type'] - else: - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - content_types_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings['http_method'], - params['body']) - if content_types_list: - params['header']['Content-Type'] = content_types_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - _request_auths=kwargs['_request_auths'], - collection_formats=params['collection_format']) + return klass.from_dict(data) diff --git a/unicourt/api_response.py b/unicourt/api_response.py new file mode 100644 index 0000000..9bc7c11 --- /dev/null +++ b/unicourt/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/unicourt/configuration.py b/unicourt/configuration.py index 6387583..9c518c9 100644 --- a/unicourt/configuration.py +++ b/unicourt/configuration.py @@ -1,22 +1,26 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import copy import logging +from logging import FileHandler import multiprocessing import sys +from typing import Optional import urllib3 -from http import client as http_client -from unicourt.exceptions import ApiValueError - +import http.client as httplib JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -24,46 +28,20 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. +class Configuration: + """This class contains various settings of the API client. - :param host: Base url + :param host: Base url. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). The dict key is the name of the security scheme in the OAS specification. The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. :param server_index: Index to servers configuration. :param server_variables: Mapping with string values to replace variables in templated server configuration. The validation of enums is performed for @@ -72,9 +50,10 @@ class Configuration(object): configuration. :param server_operation_variables: Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. + The validation of enums is performed for variables with defined enum + values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format + in PEM format. :Example: """ @@ -83,14 +62,12 @@ class Configuration(object): def __init__(self, host=None, api_key=None, api_key_prefix=None, - access_token=None, username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", + access_token=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, ssl_ca_cert=None, - ): + ) -> None: """Constructor """ self._base_path = "https://enterpriseapi.unicourt.com" if host is None else host @@ -108,7 +85,6 @@ def __init__(self, host=None, """Temp file folder for downloading files """ # Authentication Settings - self.access_token = access_token self.api_key = {} if api_key: self.api_key = api_key @@ -128,8 +104,9 @@ def __init__(self, host=None, self.password = password """Password for HTTP basic authentication """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations + self.access_token = access_token + """Access token + """ self.logger = {} """Logging Settings """ @@ -141,7 +118,7 @@ def __init__(self, host=None, self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: Optional[FileHandler] = None """Log file handler """ self.logger_file = None @@ -168,6 +145,10 @@ def __init__(self, host=None, self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved @@ -177,12 +158,9 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy = None + self.proxy: Optional[str] = None """Proxy URL """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ self.proxy_headers = None """Proxy headers """ @@ -195,8 +173,17 @@ def __init__(self, host=None, # Enable client side validation self.client_side_validation = True - # Options to pass down to the underlying urllib3 socket self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ def __deepcopy__(self, memo): cls = self.__class__ @@ -214,13 +201,6 @@ def __deepcopy__(self, memo): def __setattr__(self, name, value): object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s @classmethod def set_default(cls, default): @@ -231,21 +211,31 @@ def set_default(cls, default): :param default: object of Configuration """ - cls._default = copy.deepcopy(default) + cls._default = default @classmethod def get_default_copy(cls): - """Return new instance of configuration. + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls): + """Return the default configuration. This method returns newly created, based on default constructor, object of Configuration class or returns a copy of default - configuration passed by the set_default method. + configuration. :return: The configuration object. """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() + if cls._default is None: + cls._default = Configuration() + return cls._default @property def logger_file(self): @@ -299,15 +289,15 @@ def debug(self, value): # if debug status is True, turn on debug logging for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 @property def logger_format(self): @@ -389,7 +379,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: \n"\ - "SDK Package Version: 1.0".\ + "SDK Package Version: 1.1.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/unicourt/constants.py b/unicourt/constants.py new file mode 100644 index 0000000..0421ae7 --- /dev/null +++ b/unicourt/constants.py @@ -0,0 +1 @@ +RELEASE_VERSION="1.1.0" \ No newline at end of file diff --git a/unicourt/exceptions.py b/unicourt/exceptions.py index f1100cf..923772d 100755 --- a/unicourt/exceptions.py +++ b/unicourt/exceptions.py @@ -1,12 +1,18 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from typing import Any, Optional +from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -14,7 +20,7 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): + key_type=None) -> None: """ Raises an exception for TypeErrors Args: @@ -42,7 +48,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -60,7 +66,7 @@ def __init__(self, msg, path_to_item=None): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -79,7 +85,7 @@ def __init__(self, msg, path_to_item=None): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -97,82 +103,156 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" - error_message = "Status Code: {0}\n"\ + error_message = "({0})\n"\ "Reason: {1}\n".format(self.status, self.reason) if self.headers: error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message class SdkException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise SdkException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" - error_message = "Status Code: {0}\n"\ + error_message = "({0})\n"\ "Reason: {1}\n".format(self.status, self.reason) if self.headers: error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message -class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) - +class BadRequestException(SdkException): + pass -class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) +class NotFoundException(SdkException): + pass -class ForbiddenException(ApiException): +class UnauthorizedException(SdkException): + pass - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) +class ForbiddenException(SdkException): + pass -class ServiceException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) +class ServiceException(SdkException): + pass def render_path(path_to_item): diff --git a/unicourt/model/__init__.py b/unicourt/model/__init__.py index a5ea317..ea4fbed 100644 --- a/unicourt/model/__init__.py +++ b/unicourt/model/__init__.py @@ -1,5 +1,279 @@ -# we can not import model classes here because that would create a circular -# reference which would not work in python2 -# do not import all models into this module because that uses a lot of memory and stack frames -# if you need the ability to import all models from one package, import them with -# from unicourt.models import ModelA, ModelB +# coding: utf-8 + +# flake8: noqa +""" + UniCourt Enterprise APIs + + + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from unicourt.model.access_token_id_list_response import AccessTokenIdListResponse +from unicourt.model.access_token_id_response import AccessTokenIdResponse +from unicourt.model.access_token_request import AccessTokenRequest +from unicourt.model.access_token_response import AccessTokenResponse +from unicourt.model.additional_levels import AdditionalLevels +from unicourt.model.address import Address +from unicourt.model.area_of_law import AreaOfLaw +from unicourt.model.area_of_law_response import AreaOfLawResponse +from unicourt.model.associated_norm_attorney import AssociatedNormAttorney +from unicourt.model.associated_norm_attorney_response import AssociatedNormAttorneyResponse +from unicourt.model.associated_norm_judge import AssociatedNormJudge +from unicourt.model.associated_norm_judge_response import AssociatedNormJudgeResponse +from unicourt.model.associated_norm_law_firm import AssociatedNormLawFirm +from unicourt.model.associated_norm_law_firm_response import AssociatedNormLawFirmResponse +from unicourt.model.associated_norm_party import AssociatedNormParty +from unicourt.model.associated_norm_party_response import AssociatedNormPartyResponse +from unicourt.model.associated_so_s_person import AssociatedSoSPerson +from unicourt.model.attorney import Attorney +from unicourt.model.attorney_analytics_api import AttorneyAnalyticsAPI +from unicourt.model.attorney_law_firm import AttorneyLawFirm +from unicourt.model.attorney_representation_type import AttorneyRepresentationType +from unicourt.model.attorney_representation_type_response import AttorneyRepresentationTypeResponse +from unicourt.model.attorney_type import AttorneyType +from unicourt.model.attorney_type_response import AttorneyTypeResponse +from unicourt.model.attorneys import Attorneys +from unicourt.model.bar_record import BarRecord +from unicourt.model.bar_record_preview import BarRecordPreview +from unicourt.model.bar_source_data import BarSourceData +from unicourt.model.bar_source_data_administrative_actions_array_inner import BarSourceDataAdministrativeActionsArrayInner +from unicourt.model.bar_source_data_advanced_degree_array_inner import BarSourceDataAdvancedDegreeArrayInner +from unicourt.model.bar_source_data_bar_status_array_inner import BarSourceDataBarStatusArrayInner +from unicourt.model.bar_source_data_board_certifications_array_inner import BarSourceDataBoardCertificationsArrayInner +from unicourt.model.bar_source_data_committees_array_inner import BarSourceDataCommitteesArrayInner +from unicourt.model.bar_source_data_court_history_array_inner import BarSourceDataCourtHistoryArrayInner +from unicourt.model.bar_source_data_court_of_admissions import BarSourceDataCourtOfAdmissions +from unicourt.model.bar_source_data_disciplinary_history_array_inner import BarSourceDataDisciplinaryHistoryArrayInner +from unicourt.model.bar_source_data_discipline_summaries_array_inner import BarSourceDataDisciplineSummariesArrayInner +from unicourt.model.bar_source_data_employment_history_array_inner import BarSourceDataEmploymentHistoryArrayInner +from unicourt.model.bar_source_data_fees_options_array_inner import BarSourceDataFeesOptionsArrayInner +from unicourt.model.bar_source_data_involvements_array_inner import BarSourceDataInvolvementsArrayInner +from unicourt.model.bar_source_data_law_school_array_inner import BarSourceDataLawSchoolArrayInner +from unicourt.model.bar_source_data_name import BarSourceDataName +from unicourt.model.bar_source_data_open_action_status_array_inner import BarSourceDataOpenActionStatusArrayInner +from unicourt.model.bar_source_data_other_jurisdiction_array_inner import BarSourceDataOtherJurisdictionArrayInner +from unicourt.model.bar_source_data_public_hearing_array_inner import BarSourceDataPublicHearingArrayInner +from unicourt.model.bar_source_data_reason_for_inactivation import BarSourceDataReasonForInactivation +from unicourt.model.bar_source_data_related_cases_array_inner import BarSourceDataRelatedCasesArrayInner +from unicourt.model.bar_source_data_source_info import BarSourceDataSourceInfo +from unicourt.model.bar_source_data_statewide_grievance_committee_history_array_inner import BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner +from unicourt.model.bar_source_data_status_history_array_inner import BarSourceDataStatusHistoryArrayInner +from unicourt.model.bar_source_data_ten_year_discipline_array_inner import BarSourceDataTenYearDisciplineArrayInner +from unicourt.model.billing_cycle_usage_response import BillingCycleUsageResponse +from unicourt.model.billing_cycle_usage_response_api_calls_billable import BillingCycleUsageResponseApiCallsBillable +from unicourt.model.billing_cycle_usage_response_api_calls_credited import BillingCycleUsageResponseApiCallsCredited +from unicourt.model.billing_cycle_usage_response_api_calls_made import BillingCycleUsageResponseApiCallsMade +from unicourt.model.billing_cycle_usage_response_billing_cycle import BillingCycleUsageResponseBillingCycle +from unicourt.model.billing_cycles_response import BillingCyclesResponse +from unicourt.model.callback_list_response import CallbackListResponse +from unicourt.model.callback_list_response_case_document_order_callbacks import CallbackListResponseCaseDocumentOrderCallbacks +from unicourt.model.case import Case +from unicourt.model.case_analytics_api import CaseAnalyticsAPI +from unicourt.model.case_cause_of_action import CaseCauseOfAction +from unicourt.model.case_charge import CaseCharge +from unicourt.model.case_class import CaseClass +from unicourt.model.case_class_coverage import CaseClassCoverage +from unicourt.model.case_class_response import CaseClassResponse +from unicourt.model.case_count_analytics_by_area_of_law import CaseCountAnalyticsByAreaOfLaw +from unicourt.model.case_count_analytics_by_area_of_law_response import CaseCountAnalyticsByAreaOfLawResponse +from unicourt.model.case_count_analytics_by_case_class import CaseCountAnalyticsByCaseClass +from unicourt.model.case_count_analytics_by_case_class_response import CaseCountAnalyticsByCaseClassResponse +from unicourt.model.case_count_analytics_by_case_filed_date import CaseCountAnalyticsByCaseFiledDate +from unicourt.model.case_count_analytics_by_case_filed_date_response import CaseCountAnalyticsByCaseFiledDateResponse +from unicourt.model.case_count_analytics_by_case_type import CaseCountAnalyticsByCaseType +from unicourt.model.case_count_analytics_by_case_type_group import CaseCountAnalyticsByCaseTypeGroup +from unicourt.model.case_count_analytics_by_case_type_group_response import CaseCountAnalyticsByCaseTypeGroupResponse +from unicourt.model.case_count_analytics_by_case_type_response import CaseCountAnalyticsByCaseTypeResponse +from unicourt.model.case_count_analytics_by_court import CaseCountAnalyticsByCourt +from unicourt.model.case_count_analytics_by_court_geo import CaseCountAnalyticsByCourtGeo +from unicourt.model.case_count_analytics_by_court_location import CaseCountAnalyticsByCourtLocation +from unicourt.model.case_count_analytics_by_court_location_response import CaseCountAnalyticsByCourtLocationResponse +from unicourt.model.case_count_analytics_by_court_response import CaseCountAnalyticsByCourtResponse +from unicourt.model.case_count_analytics_by_court_system import CaseCountAnalyticsByCourtSystem +from unicourt.model.case_count_analytics_by_court_system_response import CaseCountAnalyticsByCourtSystemResponse +from unicourt.model.case_count_analytics_by_court_type import CaseCountAnalyticsByCourtType +from unicourt.model.case_count_analytics_by_court_type_response import CaseCountAnalyticsByCourtTypeResponse +from unicourt.model.case_count_analytics_by_jurisdiction_geo import CaseCountAnalyticsByJurisdictionGeo +from unicourt.model.case_count_analytics_by_jurisdiction_geo_response import CaseCountAnalyticsByJurisdictionGeoResponse +from unicourt.model.case_count_analytics_by_norm_attorney import CaseCountAnalyticsByNormAttorney +from unicourt.model.case_count_analytics_by_norm_attorney_response import CaseCountAnalyticsByNormAttorneyResponse +from unicourt.model.case_count_analytics_by_norm_judge import CaseCountAnalyticsByNormJudge +from unicourt.model.case_count_analytics_by_norm_judge_response import CaseCountAnalyticsByNormJudgeResponse +from unicourt.model.case_count_analytics_by_norm_law_firm import CaseCountAnalyticsByNormLawFirm +from unicourt.model.case_count_analytics_by_norm_law_firm_response import CaseCountAnalyticsByNormLawFirmResponse +from unicourt.model.case_count_analytics_by_norm_party import CaseCountAnalyticsByNormParty +from unicourt.model.case_count_analytics_by_norm_party_response import CaseCountAnalyticsByNormPartyResponse +from unicourt.model.case_count_analytics_by_party_role import CaseCountAnalyticsByPartyRole +from unicourt.model.case_count_analytics_by_party_role_group import CaseCountAnalyticsByPartyRoleGroup +from unicourt.model.case_count_analytics_by_party_role_group_response import CaseCountAnalyticsByPartyRoleGroupResponse +from unicourt.model.case_count_analytics_by_party_role_response import CaseCountAnalyticsByPartyRoleResponse +from unicourt.model.case_document import CaseDocument +from unicourt.model.case_document_order_callback import CaseDocumentOrderCallback +from unicourt.model.case_document_order_callback_list_response import CaseDocumentOrderCallbackListResponse +from unicourt.model.case_document_order_pacer_options import CaseDocumentOrderPacerOptions +from unicourt.model.case_document_order_request import CaseDocumentOrderRequest +from unicourt.model.case_documents import CaseDocuments +from unicourt.model.case_export_callback import CaseExportCallback +from unicourt.model.case_export_callback_list_response import CaseExportCallbackListResponse +from unicourt.model.case_relationship_type import CaseRelationshipType +from unicourt.model.case_relationship_type_response import CaseRelationshipTypeResponse +from unicourt.model.case_search_response import CaseSearchResponse +from unicourt.model.case_search_result import CaseSearchResult +from unicourt.model.case_stats import CaseStats +from unicourt.model.case_status import CaseStatus +from unicourt.model.case_status_group import CaseStatusGroup +from unicourt.model.case_status_group_response import CaseStatusGroupResponse +from unicourt.model.case_status_response import CaseStatusResponse +from unicourt.model.case_timeline import CaseTimeline +from unicourt.model.case_track import CaseTrack +from unicourt.model.case_track_list_response import CaseTrackListResponse +from unicourt.model.case_track_preview import CaseTrackPreview +from unicourt.model.case_track_request import CaseTrackRequest +from unicourt.model.case_track_schedule import CaseTrackSchedule +from unicourt.model.case_type import CaseType +from unicourt.model.case_type_group import CaseTypeGroup +from unicourt.model.case_type_group_response import CaseTypeGroupResponse +from unicourt.model.case_type_response import CaseTypeResponse +from unicourt.model.case_update import CaseUpdate +from unicourt.model.case_update_list_response import CaseUpdateListResponse +from unicourt.model.case_update_pacer_options import CaseUpdatePacerOptions +from unicourt.model.case_update_pacer_options_additional_page_array_inner import CaseUpdatePacerOptionsAdditionalPageArrayInner +from unicourt.model.case_update_pacer_options_response import CaseUpdatePacerOptionsResponse +from unicourt.model.case_update_preview import CaseUpdatePreview +from unicourt.model.case_update_request import CaseUpdateRequest +from unicourt.model.cause_of_action import CauseOfAction +from unicourt.model.cause_of_action_additional_data import CauseOfActionAdditionalData +from unicourt.model.cause_of_action_additional_data_response import CauseOfActionAdditionalDataResponse +from unicourt.model.cause_of_action_group import CauseOfActionGroup +from unicourt.model.cause_of_action_group_response import CauseOfActionGroupResponse +from unicourt.model.cause_of_action_response import CauseOfActionResponse +from unicourt.model.charge import Charge +from unicourt.model.charge_additional_data import ChargeAdditionalData +from unicourt.model.charge_additional_data_response import ChargeAdditionalDataResponse +from unicourt.model.charge_degree import ChargeDegree +from unicourt.model.charge_degree_response import ChargeDegreeResponse +from unicourt.model.charge_group import ChargeGroup +from unicourt.model.charge_group_response import ChargeGroupResponse +from unicourt.model.charge_response import ChargeResponse +from unicourt.model.charge_severity import ChargeSeverity +from unicourt.model.charge_severity_response import ChargeSeverityResponse +from unicourt.model.contact import Contact +from unicourt.model.court import Court +from unicourt.model.court_coverage import CourtCoverage +from unicourt.model.court_location import CourtLocation +from unicourt.model.court_location_response import CourtLocationResponse +from unicourt.model.court_response import CourtResponse +from unicourt.model.court_service_status import CourtServiceStatus +from unicourt.model.court_service_status_response import CourtServiceStatusResponse +from unicourt.model.court_system import CourtSystem +from unicourt.model.court_system_response import CourtSystemResponse +from unicourt.model.court_type import CourtType +from unicourt.model.court_type_response import CourtTypeResponse +from unicourt.model.daily_usage_response import DailyUsageResponse +from unicourt.model.docket_entries import DocketEntries +from unicourt.model.docket_entry import DocketEntry +from unicourt.model.docket_entry_primary_documents import DocketEntryPrimaryDocuments +from unicourt.model.docket_entry_secondary_documents import DocketEntrySecondaryDocuments +from unicourt.model.document_download import DocumentDownload +from unicourt.model.email import Email +from unicourt.model.exception import Exception +from unicourt.model.export_file import ExportFile +from unicourt.model.extracted_fields import ExtractedFields +from unicourt.model.hearing import Hearing +from unicourt.model.hearings import Hearings +from unicourt.model.individual import Individual +from unicourt.model.invalidate_access_token_request import InvalidateAccessTokenRequest +from unicourt.model.judge import Judge +from unicourt.model.judge_analytics_api import JudgeAnalyticsAPI +from unicourt.model.judge_type import JudgeType +from unicourt.model.judge_type_response import JudgeTypeResponse +from unicourt.model.judges import Judges +from unicourt.model.jurisdiction_geo import JurisdictionGeo +from unicourt.model.jurisdiction_geo_response import JurisdictionGeoResponse +from unicourt.model.last_tracked_details import LastTrackedDetails +from unicourt.model.law_firm_analytics_api import LawFirmAnalyticsAPI +from unicourt.model.matched_object import MatchedObject +from unicourt.model.nature_of_suit import NatureOfSuit +from unicourt.model.norm_attorney import NormAttorney +from unicourt.model.norm_attorney_search_response import NormAttorneySearchResponse +from unicourt.model.norm_attorney_search_result import NormAttorneySearchResult +from unicourt.model.norm_corporate_group import NormCorporateGroup +from unicourt.model.norm_judge import NormJudge +from unicourt.model.norm_judge_public_data import NormJudgePublicData +from unicourt.model.norm_judge_public_data_aba_ratings import NormJudgePublicDataAbaRatings +from unicourt.model.norm_judge_public_data_bio import NormJudgePublicDataBio +from unicourt.model.norm_judge_public_data_education_array_inner import NormJudgePublicDataEducationArrayInner +from unicourt.model.norm_judge_public_data_judicial_source import NormJudgePublicDataJudicialSource +from unicourt.model.norm_judge_public_data_name_history_array_inner import NormJudgePublicDataNameHistoryArrayInner +from unicourt.model.norm_judge_search_response import NormJudgeSearchResponse +from unicourt.model.norm_judge_search_result import NormJudgeSearchResult +from unicourt.model.norm_law_firm import NormLawFirm +from unicourt.model.norm_law_firm_search_response import NormLawFirmSearchResponse +from unicourt.model.norm_law_firm_search_result import NormLawFirmSearchResult +from unicourt.model.norm_organization import NormOrganization +from unicourt.model.norm_organization_ticker_array_inner import NormOrganizationTickerArrayInner +from unicourt.model.norm_party import NormParty +from unicourt.model.norm_party_search_response import NormPartySearchResponse +from unicourt.model.norm_party_search_result import NormPartySearchResult +from unicourt.model.pacer_case_search_content import PACERCaseSearchContent +from unicourt.model.pacer_case_search_results import PACERCaseSearchResults +from unicourt.model.pacer_import_case import PACERImportCase +from unicourt.model.pacer_import_case_results import PACERImportCaseResults +from unicourt.model.pacer_party_search_content import PACERPartySearchContent +from unicourt.model.pacer_party_search_results import PACERPartySearchResults +from unicourt.model.pacer_search_page_info import PACERSearchPageInfo +from unicourt.model.pacer_search_receipt import PACERSearchReceipt +from unicourt.model.pcl_case import PCLCase +from unicourt.model.pcl_party import PCLParty +from unicourt.model.pacer_credential import PacerCredential +from unicourt.model.pacer_credential_list_response import PacerCredentialListResponse +from unicourt.model.pacer_credential_request import PacerCredentialRequest +from unicourt.model.parties import Parties +from unicourt.model.party import Party +from unicourt.model.party_analytics_api import PartyAnalyticsAPI +from unicourt.model.party_attorney_association import PartyAttorneyAssociation +from unicourt.model.party_attorney_associations import PartyAttorneyAssociations +from unicourt.model.party_role import PartyRole +from unicourt.model.party_role_group import PartyRoleGroup +from unicourt.model.party_role_group_response import PartyRoleGroupResponse +from unicourt.model.party_role_response import PartyRoleResponse +from unicourt.model.phone import Phone +from unicourt.model.possible_norm_attorney import PossibleNormAttorney +from unicourt.model.possible_norm_attorney_score_constituents import PossibleNormAttorneyScoreConstituents +from unicourt.model.possible_norm_judge import PossibleNormJudge +from unicourt.model.possible_norm_judge_score_constituents import PossibleNormJudgeScoreConstituents +from unicourt.model.possible_norm_law_firm import PossibleNormLawFirm +from unicourt.model.possible_norm_law_firm_score_constituents import PossibleNormLawFirmScoreConstituents +from unicourt.model.possible_norm_law_firm_source_details import PossibleNormLawFirmSourceDetails +from unicourt.model.possible_norm_party import PossibleNormParty +from unicourt.model.possible_norm_party_score_constituents import PossibleNormPartyScoreConstituents +from unicourt.model.preview_document import PreviewDocument +from unicourt.model.raw_ordered_data import RawOrderedData +from unicourt.model.raw_ordered_data_child import RawOrderedDataChild +from unicourt.model.raw_ordered_data_child_child_array_inner import RawOrderedDataChildChildArrayInner +from unicourt.model.referenced_docket_number import ReferencedDocketNumber +from unicourt.model.related_case import RelatedCase +from unicourt.model.related_cases import RelatedCases +from unicourt.model.related_norm_party import RelatedNormParty +from unicourt.model.sos_associated_norm_organization import SOSAssociatedNormOrganization +from unicourt.model.sos_data import SOSData +from unicourt.model.sos_data_preview import SOSDataPreview +from unicourt.model.sos_name_change import SOSNameChange +from unicourt.model.schedule import Schedule +from unicourt.model.service_history import ServiceHistory +from unicourt.model.service_status import ServiceStatus +from unicourt.model.service_status_down_details import ServiceStatusDownDetails +from unicourt.model.similar_norm_attorney import SimilarNormAttorney +from unicourt.model.source_case_data import SourceCaseData +from unicourt.model.source_cause_of_action import SourceCauseOfAction +from unicourt.model.source_charge import SourceCharge +from unicourt.model.source_charge_additional_data import SourceChargeAdditionalData +from unicourt.model.source_page_data import SourcePageData +from unicourt.model.source_structured_data import SourceStructuredData +from unicourt.model.success import Success diff --git a/unicourt/model/access_token_id_list_response.py b/unicourt/model/access_token_id_list_response.py index 2d5a29a..549529e 100644 --- a/unicourt/model/access_token_id_list_response.py +++ b/unicourt/model/access_token_id_list_response.py @@ -1,291 +1,98 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.access_token_id_response import AccessTokenIdResponse - globals()['AccessTokenIdResponse'] = AccessTokenIdResponse - - -class AccessTokenIdListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 25, - 'min_length': 25, - }, - ('access_token_id_array',): { - 'max_items': 10, - 'min_items': 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'access_token_id_array': ([AccessTokenIdResponse],), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.access_token_id_response import AccessTokenIdResponse +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class AccessTokenIdListResponse(BaseModel): + """ + AccessTokenIdListResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default='AccessTokenIdListResponse', description="Name of the object.") + access_token_id_array: Optional[Annotated[List[AccessTokenIdResponse], Field(min_length=0, max_length=10)]] = Field(default=None, description="Array of access tokens Id.", alias="AccessTokenIdArray") + __properties: ClassVar[List[str]] = ["object", "AccessTokenIdArray"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'object': 'object', # noqa: E501 - 'access_token_id_array': 'AccessTokenIdArray', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, access_token_id_array, *args, **kwargs): # noqa: E501 - """AccessTokenIdListResponse - a model defined in OpenAPI - - Args: - access_token_id_array ([AccessTokenIdResponse]): Array of access tokens Id. - - Keyword Args: - object (str): Name of the object.. defaults to "AccessTokenIdListResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccessTokenIdListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "AccessTokenIdListResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.access_token_id_array = access_token_id_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, access_token_id_array, *args, **kwargs): # noqa: E501 - """AccessTokenIdListResponse - a model defined in OpenAPI - - Args: - access_token_id_array ([AccessTokenIdResponse]): Array of access tokens Id. - - Keyword Args: - object (str): Name of the object.. defaults to "AccessTokenIdListResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in access_token_id_array (list) + _items = [] + if self.access_token_id_array: + for _item in self.access_token_id_array: + if _item: + _items.append(_item.to_dict()) + _dict['AccessTokenIdArray'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccessTokenIdListResponse from a dict""" + if obj is None: + return None - object = kwargs.get('object', "AccessTokenIdListResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AccessTokenIdListResponse', + "AccessTokenIdArray": [AccessTokenIdResponse.from_dict(_item) for _item in obj["AccessTokenIdArray"]] if obj.get("AccessTokenIdArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.access_token_id_array = access_token_id_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/access_token_id_response.py b/unicourt/model/access_token_id_response.py index 7318171..5db88f8 100644 --- a/unicourt/model/access_token_id_response.py +++ b/unicourt/model/access_token_id_response.py @@ -1,305 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class AccessTokenIdResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class AccessTokenIdResponse(BaseModel): """ + AccessTokenIdResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=21, strict=True, max_length=21)]] = Field(default='AccessTokenIdResponse', description="Name of the object.") + token_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Unique Id for the access token.", alias="tokenId") + issued_date: Optional[datetime] = Field(default=None, description="Date when access token was created.", alias="issuedDate") + issue_address: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=15)]] = Field(default=None, description="Ip address.", alias="issueAddress") + __properties: ClassVar[List[str]] = ["object", "tokenId", "issuedDate", "issueAddress"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 21, - 'min_length': 21, - }, - ('token_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('issued_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('issue_address',): { - 'max_length': 15, - 'min_length': 7, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccessTokenIdResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'token_id': (str,), # noqa: E501 - 'issued_date': (datetime,), # noqa: E501 - 'issue_address': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'token_id': 'tokenId', # noqa: E501 - 'issued_date': 'issuedDate', # noqa: E501 - 'issue_address': 'issueAddress', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, token_id, issued_date, issue_address, *args, **kwargs): # noqa: E501 - """AccessTokenIdResponse - a model defined in OpenAPI - - Args: - token_id (str): Unique Id for the access token. - issued_date (datetime): Date when access token was created. - issue_address (str): Ip address. - - Keyword Args: - object (str): Name of the object.. defaults to "AccessTokenIdResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AccessTokenIdResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.token_id = token_id - self.issued_date = issued_date - self.issue_address = issue_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, token_id, issued_date, issue_address, *args, **kwargs): # noqa: E501 - """AccessTokenIdResponse - a model defined in OpenAPI - - Args: - token_id (str): Unique Id for the access token. - issued_date (datetime): Date when access token was created. - issue_address (str): Ip address. - - Keyword Args: - object (str): Name of the object.. defaults to "AccessTokenIdResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccessTokenIdResponse from a dict""" + if obj is None: + return None - object = kwargs.get('object', "AccessTokenIdResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AccessTokenIdResponse', + "tokenId": obj.get("tokenId"), + "issuedDate": obj.get("issuedDate"), + "issueAddress": obj.get("issueAddress") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.token_id = token_id - self.issued_date = issued_date - self.issue_address = issue_address - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/access_token_request.py b/unicourt/model/access_token_request.py index b204a8c..ae60221 100644 --- a/unicourt/model/access_token_request.py +++ b/unicourt/model/access_token_request.py @@ -1,283 +1,90 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class AccessTokenRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('client_id',): { - 'max_length': 32, - 'min_length': 32, - }, - ('client_secret',): { - 'max_length': 64, - 'min_length': 64, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'client_id': (str,), # noqa: E501 - 'client_secret': (str,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class AccessTokenRequest(BaseModel): + """ + AccessTokenRequest + """ # noqa: E501 + client_id: Annotated[str, Field(min_length=32, strict=True, max_length=32)] = Field(description="Your Client ID obtainable by logging into your UniCourt account.", alias="clientId") + client_secret: Annotated[str, Field(min_length=64, strict=True, max_length=64)] = Field(description="Your Client Secret ID obtainable by logging into your UniCourt account.", alias="clientSecret") + __properties: ClassVar[List[str]] = ["clientId", "clientSecret"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'client_id': 'clientId', # noqa: E501 - 'client_secret': 'clientSecret', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, client_secret, *args, **kwargs): # noqa: E501 - """AccessTokenRequest - a model defined in OpenAPI - - Args: - client_id (str): Your Client ID obtainable by logging into your UniCourt account. - client_secret (str): Your Client Secret ID obtainable by logging into your UniCourt account. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccessTokenRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.client_secret = client_secret - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, client_secret, *args, **kwargs): # noqa: E501 - """AccessTokenRequest - a model defined in OpenAPI + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - Args: - client_id (str): Your Client ID obtainable by logging into your UniCourt account. - client_secret (str): Your Client Secret ID obtainable by logging into your UniCourt account. + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccessTokenRequest from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "clientId": obj.get("clientId"), + "clientSecret": obj.get("clientSecret") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.client_id = client_id - self.client_secret = client_secret - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/access_token_response.py b/unicourt/model/access_token_response.py index c9c4493..81a1670 100644 --- a/unicourt/model/access_token_response.py +++ b/unicourt/model/access_token_response.py @@ -1,305 +1,94 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class AccessTokenResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class AccessTokenResponse(BaseModel): """ + AccessTokenResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=19, strict=True, max_length=19)]] = Field(default='AccessTokenResponse', description="Name of the object.") + access_token: Optional[Annotated[str, Field(min_length=700, strict=True, max_length=2000)]] = Field(default=None, description="Access token for API.", alias="accessToken") + token_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Unique Id for the access token.", alias="tokenId") + token_type: Optional[Annotated[str, Field(min_length=6, strict=True, max_length=6)]] = Field(default=None, description="Token type.", alias="tokenType") + __properties: ClassVar[List[str]] = ["object", "accessToken", "tokenId", "tokenType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 19, - 'min_length': 19, - }, - ('access_token',): { - 'max_length': 2000, - 'min_length': 700, - }, - ('token_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('token_type',): { - 'max_length': 6, - 'min_length': 6, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccessTokenResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'access_token': (str,), # noqa: E501 - 'token_id': (str,), # noqa: E501 - 'token_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'access_token': 'accessToken', # noqa: E501 - 'token_id': 'tokenId', # noqa: E501 - 'token_type': 'tokenType', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, access_token, token_id, token_type, *args, **kwargs): # noqa: E501 - """AccessTokenResponse - a model defined in OpenAPI - - Args: - access_token (str): Access token for API. - token_id (str): Unique Id for the access token. - token_type (str): Token type. - - Keyword Args: - object (str): Name of the object.. defaults to "AccessTokenResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AccessTokenResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.access_token = access_token - self.token_id = token_id - self.token_type = token_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, access_token, token_id, token_type, *args, **kwargs): # noqa: E501 - """AccessTokenResponse - a model defined in OpenAPI - - Args: - access_token (str): Access token for API. - token_id (str): Unique Id for the access token. - token_type (str): Token type. - - Keyword Args: - object (str): Name of the object.. defaults to "AccessTokenResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccessTokenResponse from a dict""" + if obj is None: + return None - object = kwargs.get('object', "AccessTokenResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AccessTokenResponse', + "accessToken": obj.get("accessToken"), + "tokenId": obj.get("tokenId"), + "tokenType": obj.get("tokenType") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.access_token = access_token - self.token_id = token_id - self.token_type = token_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/additional_levels.py b/unicourt/model/additional_levels.py index 96f296a..e1b95dd 100644 --- a/unicourt/model/additional_levels.py +++ b/unicourt/model/additional_levels.py @@ -1,315 +1,116 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class AdditionalLevels(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class AdditionalLevels(BaseModel): """ + AdditionalLevels + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=16, strict=True, max_length=16)]] = 'AdditionalLevels' + level1: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + level2: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + level3: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + level4: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + __properties: ClassVar[List[str]] = ["object", "level1", "level2", "level3", "level4"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 16, - 'min_length': 16, - }, - ('level1',): { - 'max_length': 255, - 'min_length': 1, - }, - ('level2',): { - 'max_length': 255, - 'min_length': 1, - }, - ('level3',): { - 'max_length': 255, - 'min_length': 1, - }, - ('level4',): { - 'max_length': 255, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AdditionalLevels from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'level1': (str, none_type,), # noqa: E501 - 'level2': (str, none_type,), # noqa: E501 - 'level3': (str, none_type,), # noqa: E501 - 'level4': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'level1': 'level1', # noqa: E501 - 'level2': 'level2', # noqa: E501 - 'level3': 'level3', # noqa: E501 - 'level4': 'level4', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if level1 (nullable) is None + # and model_fields_set contains the field + if self.level1 is None and "level1" in self.model_fields_set: + _dict['level1'] = None + + # set to None if level2 (nullable) is None + # and model_fields_set contains the field + if self.level2 is None and "level2" in self.model_fields_set: + _dict['level2'] = None + + # set to None if level3 (nullable) is None + # and model_fields_set contains the field + if self.level3 is None and "level3" in self.model_fields_set: + _dict['level3'] = None + + # set to None if level4 (nullable) is None + # and model_fields_set contains the field + if self.level4 is None and "level4" in self.model_fields_set: + _dict['level4'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, level1, level2, level3, level4, *args, **kwargs): # noqa: E501 - """AdditionalLevels - a model defined in OpenAPI - - Args: - level1 (str, none_type): - level2 (str, none_type): - level3 (str, none_type): - level4 (str, none_type): - - Keyword Args: - object (str): defaults to "AdditionalLevels" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AdditionalLevels") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.level1 = level1 - self.level2 = level2 - self.level3 = level3 - self.level4 = level4 - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, level1, level2, level3, level4, *args, **kwargs): # noqa: E501 - """AdditionalLevels - a model defined in OpenAPI - - Args: - level1 (str, none_type): - level2 (str, none_type): - level3 (str, none_type): - level4 (str, none_type): - - Keyword Args: - object (str): defaults to "AdditionalLevels" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AdditionalLevels from a dict""" + if obj is None: + return None - object = kwargs.get('object', "AdditionalLevels") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AdditionalLevels', + "level1": obj.get("level1"), + "level2": obj.get("level2"), + "level3": obj.get("level3"), + "level4": obj.get("level4") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.level1 = level1 - self.level2 = level2 - self.level3 = level3 - self.level4 = level4 - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/address.py b/unicourt/model/address.py index 64fdc3d..b3da628 100644 --- a/unicourt/model/address.py +++ b/unicourt/model/address.py @@ -1,415 +1,162 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class Address(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 7, - 'min_length': 7, - }, - ('street_address1',): { - 'max_length': 250, - 'min_length': 1, - }, - ('street_address2',): { - 'max_length': 150, - 'min_length': 1, - }, - ('city',): { - 'max_length': 100, - 'min_length': 1, - }, - ('state_name',): { - 'max_length': 100, - 'min_length': 1, - }, - ('state_code',): { - 'max_length': 2, - 'min_length': 2, - }, - ('country_name',): { - 'max_length': 100, - 'min_length': 1, - }, - ('country_code',): { - 'max_length': 3, - 'min_length': 2, - }, - ('zip',): { - 'max_length': 10, - 'min_length': 1, - }, - ('zip4',): { - 'max_length': 4, - 'min_length': 4, - }, - ('first_fetch_date',): { - 'max_length': 35, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 35, - 'min_length': 25, - }, - ('latitude',): { - 'inclusive_maximum': 90, - 'inclusive_minimum': -90, - }, - ('longitude',): { - 'inclusive_maximum': 180, - 'inclusive_minimum': -180, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'street_address1': (str, none_type,), # noqa: E501 - 'street_address2': (str, none_type,), # noqa: E501 - 'city': (str, none_type,), # noqa: E501 - 'state_name': (str,), # noqa: E501 - 'state_code': (str, none_type,), # noqa: E501 - 'country_name': (str,), # noqa: E501 - 'country_code': (str, none_type,), # noqa: E501 - 'zip': (str, none_type,), # noqa: E501 - 'zip4': (str, none_type,), # noqa: E501 - 'is_visible': (bool,), # noqa: E501 - 'first_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date': (datetime,), # noqa: E501 - 'latitude': (float, none_type,), # noqa: E501 - 'longitude': (float, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'street_address1': 'streetAddress1', # noqa: E501 - 'street_address2': 'streetAddress2', # noqa: E501 - 'city': 'city', # noqa: E501 - 'state_name': 'stateName', # noqa: E501 - 'state_code': 'stateCode', # noqa: E501 - 'country_name': 'countryName', # noqa: E501 - 'country_code': 'countryCode', # noqa: E501 - 'zip': 'zip', # noqa: E501 - 'zip4': 'zip4', # noqa: E501 - 'is_visible': 'isVisible', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'latitude': 'latitude', # noqa: E501 - 'longitude': 'longitude', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class Address(BaseModel): + """ + Address object Data Schema + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=7)]] = 'Address' + street_address1: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=250)]] = Field(default=None, description="1st part of the street address.", alias="streetAddress1") + street_address2: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=150)]] = Field(default=None, description="2nd part of the street address.", alias="streetAddress2") + city: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=100)]] = Field(default=None, description="City") + state_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=100)]] = Field(default='UNKNOWN', description="State Name if present else default value.", alias="stateName") + state_code: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=2)]] = Field(default=None, description="State Code if the state is a US state else contains null.", alias="stateCode") + country_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=100)]] = Field(default='UNKNOWN', description="Country Name if present else default value.", alias="countryName") + country_code: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=3)]] = Field(default=None, description="ISO 3166-1 alpha-3 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements). Code of the country if country name is present.", alias="countryCode") + zip: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=10)]] = Field(default=None, description="Zip code of the address.") + zip4: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]] = Field(default=None, description="4 digit extension of the zip code if the address is a US address.") + is_visible: Optional[StrictBool] = Field(default=None, description="Boolean indicating if the address is visible or not.", alias="isVisible") + first_fetch_date: Optional[datetime] = Field(default=None, description="Date at which this record is created in UniCourt.", alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, description="Date at which this record was updated in UniCourt.", alias="lastFetchDate") + latitude: Optional[Union[Annotated[float, Field(le=90, strict=True, ge=-90)], Annotated[int, Field(le=90, strict=True, ge=-90)]]] = Field(default=None, description="Coordinates at geographic coordinate system.") + longitude: Optional[Union[Annotated[float, Field(le=180, strict=True, ge=-180)], Annotated[int, Field(le=180, strict=True, ge=-180)]]] = Field(default=None, description="Coordinates at geographic coordinate system.") + __properties: ClassVar[List[str]] = ["object", "streetAddress1", "streetAddress2", "city", "stateName", "stateCode", "countryName", "countryCode", "zip", "zip4", "isVisible", "firstFetchDate", "lastFetchDate", "latitude", "longitude"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, street_address1, street_address2, city, state_code, country_code, zip, zip4, is_visible, first_fetch_date, last_fetch_date, latitude, longitude, *args, **kwargs): # noqa: E501 - """Address - a model defined in OpenAPI - - Args: - street_address1 (str, none_type): 1st part of the street address. - street_address2 (str, none_type): 2nd part of the street address. - city (str, none_type): City - state_code (str, none_type): State Code if the state is a US state else contains null. - country_code (str, none_type): ISO 3166-1 alpha-3 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements). Code of the country if country name is present. - zip (str, none_type): Zip code of the address. - zip4 (str, none_type): 4 digit extension of the zip code if the address is a US address. - is_visible (bool): Boolean indicating if the address is visible or not. - first_fetch_date (datetime): Date at which this record is created in UniCourt. - last_fetch_date (datetime): Date at which this record was updated in UniCourt. - latitude (float, none_type): Coordinates at geographic coordinate system. - longitude (float, none_type): Coordinates at geographic coordinate system. - - Keyword Args: - object (str): defaults to "Address" # noqa: E501 - state_name (str): State Name if present else default value.. defaults to "UNKNOWN" # noqa: E501 - country_name (str): Country Name if present else default value.. defaults to "UNKNOWN" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Address from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "Address") - state_name = kwargs.get('state_name', "UNKNOWN") - country_name = kwargs.get('country_name', "UNKNOWN") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.street_address1 = street_address1 - self.street_address2 = street_address2 - self.city = city - self.state_name = state_name - self.state_code = state_code - self.country_name = country_name - self.country_code = country_code - self.zip = zip - self.zip4 = zip4 - self.is_visible = is_visible - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.latitude = latitude - self.longitude = longitude - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, street_address1, street_address2, city, state_code, country_code, zip, zip4, is_visible, first_fetch_date, last_fetch_date, latitude, longitude, *args, **kwargs): # noqa: E501 - """Address - a model defined in OpenAPI - - Args: - street_address1 (str, none_type): 1st part of the street address. - street_address2 (str, none_type): 2nd part of the street address. - city (str, none_type): City - state_code (str, none_type): State Code if the state is a US state else contains null. - country_code (str, none_type): ISO 3166-1 alpha-3 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements). Code of the country if country name is present. - zip (str, none_type): Zip code of the address. - zip4 (str, none_type): 4 digit extension of the zip code if the address is a US address. - is_visible (bool): Boolean indicating if the address is visible or not. - first_fetch_date (datetime): Date at which this record is created in UniCourt. - last_fetch_date (datetime): Date at which this record was updated in UniCourt. - latitude (float, none_type): Coordinates at geographic coordinate system. - longitude (float, none_type): Coordinates at geographic coordinate system. - - Keyword Args: - object (str): defaults to "Address" # noqa: E501 - state_name (str): State Name if present else default value.. defaults to "UNKNOWN" # noqa: E501 - country_name (str): Country Name if present else default value.. defaults to "UNKNOWN" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if street_address1 (nullable) is None + # and model_fields_set contains the field + if self.street_address1 is None and "street_address1" in self.model_fields_set: + _dict['streetAddress1'] = None + + # set to None if street_address2 (nullable) is None + # and model_fields_set contains the field + if self.street_address2 is None and "street_address2" in self.model_fields_set: + _dict['streetAddress2'] = None + + # set to None if city (nullable) is None + # and model_fields_set contains the field + if self.city is None and "city" in self.model_fields_set: + _dict['city'] = None + + # set to None if state_code (nullable) is None + # and model_fields_set contains the field + if self.state_code is None and "state_code" in self.model_fields_set: + _dict['stateCode'] = None + + # set to None if country_code (nullable) is None + # and model_fields_set contains the field + if self.country_code is None and "country_code" in self.model_fields_set: + _dict['countryCode'] = None + + # set to None if zip (nullable) is None + # and model_fields_set contains the field + if self.zip is None and "zip" in self.model_fields_set: + _dict['zip'] = None + + # set to None if zip4 (nullable) is None + # and model_fields_set contains the field + if self.zip4 is None and "zip4" in self.model_fields_set: + _dict['zip4'] = None + + # set to None if latitude (nullable) is None + # and model_fields_set contains the field + if self.latitude is None and "latitude" in self.model_fields_set: + _dict['latitude'] = None + + # set to None if longitude (nullable) is None + # and model_fields_set contains the field + if self.longitude is None and "longitude" in self.model_fields_set: + _dict['longitude'] = None + + return _dict - object = kwargs.get('object', "Address") - state_name = kwargs.get('state_name', "UNKNOWN") - country_name = kwargs.get('country_name', "UNKNOWN") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Address from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Address', + "streetAddress1": obj.get("streetAddress1"), + "streetAddress2": obj.get("streetAddress2"), + "city": obj.get("city"), + "stateName": obj.get("stateName") if obj.get("stateName") is not None else 'UNKNOWN', + "stateCode": obj.get("stateCode"), + "countryName": obj.get("countryName") if obj.get("countryName") is not None else 'UNKNOWN', + "countryCode": obj.get("countryCode"), + "zip": obj.get("zip"), + "zip4": obj.get("zip4"), + "isVisible": obj.get("isVisible"), + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate"), + "latitude": obj.get("latitude"), + "longitude": obj.get("longitude") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.street_address1 = street_address1 - self.street_address2 = street_address2 - self.city = city - self.state_name = state_name - self.state_code = state_code - self.country_name = country_name - self.country_code = country_code - self.zip = zip - self.zip4 = zip4 - self.is_visible = is_visible - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.latitude = latitude - self.longitude = longitude - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/area_of_law.py b/unicourt/model/area_of_law.py index f67e9ec..d98dcf4 100644 --- a/unicourt/model/area_of_law.py +++ b/unicourt/model/area_of_law.py @@ -1,325 +1,99 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class AreaOfLaw(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class AreaOfLaw(BaseModel): """ + AreaOfLaw + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]] = 'AreaOfLaw' + area_of_law_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="areaOfLawId") + case_class_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="caseClassId") + case_class: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="caseClass") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "areaOfLawId", "caseClassId", "caseClass", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 9, - 'min_length': 9, - }, - ('area_of_law_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_class_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_class',): { - 'max_length': 255, - 'min_length': 1, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AreaOfLaw from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'area_of_law_id': (str,), # noqa: E501 - 'case_class_id': (str,), # noqa: E501 - 'case_class': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'area_of_law_id': 'areaOfLawId', # noqa: E501 - 'case_class_id': 'caseClassId', # noqa: E501 - 'case_class': 'caseClass', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, area_of_law_id, case_class_id, case_class, name, created_date, *args, **kwargs): # noqa: E501 - """AreaOfLaw - a model defined in OpenAPI - - Args: - area_of_law_id (str): - case_class_id (str): - case_class (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "AreaOfLaw" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AreaOfLaw") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.area_of_law_id = area_of_law_id - self.case_class_id = case_class_id - self.case_class = case_class - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, area_of_law_id, case_class_id, case_class, name, created_date, *args, **kwargs): # noqa: E501 - """AreaOfLaw - a model defined in OpenAPI - - Args: - area_of_law_id (str): - case_class_id (str): - case_class (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "AreaOfLaw" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AreaOfLaw from a dict""" + if obj is None: + return None - object = kwargs.get('object', "AreaOfLaw") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AreaOfLaw', + "areaOfLawId": obj.get("areaOfLawId"), + "caseClassId": obj.get("caseClassId"), + "caseClass": obj.get("caseClass"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.area_of_law_id = area_of_law_id - self.case_class_id = case_class_id - self.case_class = case_class - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/area_of_law_response.py b/unicourt/model/area_of_law_response.py index 0a40e0c..f10c92d 100644 --- a/unicourt/model/area_of_law_response.py +++ b/unicourt/model/area_of_law_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.area_of_law import AreaOfLaw - globals()['AreaOfLaw'] = AreaOfLaw - - -class AreaOfLawResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 17, - 'min_length': 17, - }, - ('area_of_law_array',): { - }, - ('next_page_api',): { - 'max_length': 2140, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2139, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'area_of_law_array': ([AreaOfLaw],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'area_of_law_array': 'areaOfLawArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.area_of_law import AreaOfLaw +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class AreaOfLawResponse(BaseModel): + """ + AreaOfLawResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=17)]] = 'AreaOfLawResponse' + area_of_law_array: Optional[List[AreaOfLaw]] = Field(default=None, alias="areaOfLawArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2140)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2139)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "areaOfLawArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, area_of_law_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """AreaOfLawResponse - a model defined in OpenAPI - - Args: - area_of_law_array ([AreaOfLaw]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "AreaOfLawResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AreaOfLawResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AreaOfLawResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.area_of_law_array = area_of_law_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, area_of_law_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """AreaOfLawResponse - a model defined in OpenAPI - - Args: - area_of_law_array ([AreaOfLaw]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "AreaOfLawResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in area_of_law_array (list) + _items = [] + if self.area_of_law_array: + for _item in self.area_of_law_array: + if _item: + _items.append(_item.to_dict()) + _dict['areaOfLawArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "AreaOfLawResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AreaOfLawResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AreaOfLawResponse', + "areaOfLawArray": [AreaOfLaw.from_dict(_item) for _item in obj["areaOfLawArray"]] if obj.get("areaOfLawArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.area_of_law_array = area_of_law_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/associated_norm_attorney.py b/unicourt/model/associated_norm_attorney.py index acb1670..0e170c5 100644 --- a/unicourt/model/associated_norm_attorney.py +++ b/unicourt/model/associated_norm_attorney.py @@ -1,364 +1,125 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.bar_record_preview import BarRecordPreview - from unicourt.model.case_timeline import CaseTimeline - globals()['BarRecordPreview'] = BarRecordPreview - globals()['CaseTimeline'] = CaseTimeline - - -class AssociatedNormAttorney(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 22, - }, - ('norm_attorney_api',): { - 'max_length': 255, - }, - ('norm_attorney_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 500, - }, - ('first_name',): { - 'max_length': 500, - }, - ('middle_name',): { - 'max_length': 500, - }, - ('last_name',): { - 'max_length': 500, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_attorney_api': (str,), # noqa: E501 - 'norm_attorney_id': (str,), # noqa: E501 - 'case_timeline': (CaseTimeline,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'first_name': (str,), # noqa: E501 - 'middle_name': (str, none_type,), # noqa: E501 - 'last_name': (str,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'state_bar_data_array': ([BarRecordPreview],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_attorney_api': 'normAttorneyAPI', # noqa: E501 - 'norm_attorney_id': 'normAttorneyId', # noqa: E501 - 'case_timeline': 'caseTimeline', # noqa: E501 - 'name': 'name', # noqa: E501 - 'first_name': 'firstName', # noqa: E501 - 'middle_name': 'middleName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'state_bar_data_array': 'stateBarDataArray', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.bar_record_preview import BarRecordPreview +from unicourt.model.case_timeline import CaseTimeline +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class AssociatedNormAttorney(BaseModel): + """ + AssociatedNormAttorney + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=22)]] = 'AssociatedNormAttorney' + norm_attorney_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to details for the Attorney.", alias="normAttorneyAPI") + norm_attorney_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normAttorneyId") + case_timeline: Optional[CaseTimeline] = Field(default=None, alias="caseTimeline") + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + first_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="firstName") + middle_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="middleName") + last_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="lastName") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to related cases for this association.", alias="caseSearchAPI") + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + state_bar_data_array: Optional[List[BarRecordPreview]] = Field(default=None, alias="stateBarDataArray") + __properties: ClassVar[List[str]] = ["object", "normAttorneyAPI", "normAttorneyId", "caseTimeline", "name", "firstName", "middleName", "lastName", "caseSearchAPI", "caseCount", "stateBarDataArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_attorney_api, norm_attorney_id, case_timeline, name, first_name, middle_name, last_name, case_search_api, case_count, state_bar_data_array, *args, **kwargs): # noqa: E501 - """AssociatedNormAttorney - a model defined in OpenAPI - - Args: - norm_attorney_api (str): Link to details for the Attorney. - norm_attorney_id (str): - case_timeline (CaseTimeline): - name (str): - first_name (str): - middle_name (str, none_type): - last_name (str): - case_search_api (str): Link to related cases for this association. - case_count (int): - state_bar_data_array ([BarRecordPreview]): - - Keyword Args: - object (str): defaults to "AssociatedNormAttorney" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AssociatedNormAttorney") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssociatedNormAttorney from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_attorney_api = norm_attorney_api - self.norm_attorney_id = norm_attorney_id - self.case_timeline = case_timeline - self.name = name - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.case_search_api = case_search_api - self.case_count = case_count - self.state_bar_data_array = state_bar_data_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_attorney_api, norm_attorney_id, case_timeline, name, first_name, middle_name, last_name, case_search_api, case_count, state_bar_data_array, *args, **kwargs): # noqa: E501 - """AssociatedNormAttorney - a model defined in OpenAPI - - Args: - norm_attorney_api (str): Link to details for the Attorney. - norm_attorney_id (str): - case_timeline (CaseTimeline): - name (str): - first_name (str): - middle_name (str, none_type): - last_name (str): - case_search_api (str): Link to related cases for this association. - case_count (int): - state_bar_data_array ([BarRecordPreview]): - - Keyword Args: - object (str): defaults to "AssociatedNormAttorney" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_timeline + if self.case_timeline: + _dict['caseTimeline'] = self.case_timeline.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in state_bar_data_array (list) + _items = [] + if self.state_bar_data_array: + for _item in self.state_bar_data_array: + if _item: + _items.append(_item.to_dict()) + _dict['stateBarDataArray'] = _items + # set to None if middle_name (nullable) is None + # and model_fields_set contains the field + if self.middle_name is None and "middle_name" in self.model_fields_set: + _dict['middleName'] = None + + return _dict - object = kwargs.get('object', "AssociatedNormAttorney") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssociatedNormAttorney from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AssociatedNormAttorney', + "normAttorneyAPI": obj.get("normAttorneyAPI"), + "normAttorneyId": obj.get("normAttorneyId"), + "caseTimeline": CaseTimeline.from_dict(obj["caseTimeline"]) if obj.get("caseTimeline") is not None else None, + "name": obj.get("name"), + "firstName": obj.get("firstName"), + "middleName": obj.get("middleName"), + "lastName": obj.get("lastName"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseCount": obj.get("caseCount"), + "stateBarDataArray": [BarRecordPreview.from_dict(_item) for _item in obj["stateBarDataArray"]] if obj.get("stateBarDataArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_attorney_api = norm_attorney_api - self.norm_attorney_id = norm_attorney_id - self.case_timeline = case_timeline - self.name = name - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.case_search_api = case_search_api - self.case_count = case_count - self.state_bar_data_array = state_bar_data_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/associated_norm_attorney_response.py b/unicourt/model/associated_norm_attorney_response.py index 593c911..1e8f87b 100644 --- a/unicourt/model/associated_norm_attorney_response.py +++ b/unicourt/model/associated_norm_attorney_response.py @@ -1,305 +1,116 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.associated_norm_attorney import AssociatedNormAttorney - globals()['AssociatedNormAttorney'] = AssociatedNormAttorney +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class AssociatedNormAttorneyResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.associated_norm_attorney import AssociatedNormAttorney +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class AssociatedNormAttorneyResponse(BaseModel): """ + AssociatedNormAttorneyResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=30)]] = 'AssociatedNormAttorneyResponse' + associated_norm_attorney_array: Optional[List[AssociatedNormAttorney]] = Field(default=None, alias="associatedNormAttorneyArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Previous page of results if applicable.", alias="previousPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total no. of results for this criteria.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "associatedNormAttorneyArray", "nextPageAPI", "previousPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssociatedNormAttorneyResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'associated_norm_attorney_array': ([AssociatedNormAttorney],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'associated_norm_attorney_array': 'associatedNormAttorneyArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in associated_norm_attorney_array (list) + _items = [] + if self.associated_norm_attorney_array: + for _item in self.associated_norm_attorney_array: + if _item: + _items.append(_item.to_dict()) + _dict['associatedNormAttorneyArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, associated_norm_attorney_array, next_page_api, previous_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """AssociatedNormAttorneyResponse - a model defined in OpenAPI - - Args: - associated_norm_attorney_array ([AssociatedNormAttorney]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Previous page of results if applicable. - total_pages (int): Total no. of pages. - total_count (int): Total no. of results for this criteria. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.associated_norm_attorney_array = associated_norm_attorney_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, associated_norm_attorney_array, next_page_api, previous_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """AssociatedNormAttorneyResponse - a model defined in OpenAPI - - Args: - associated_norm_attorney_array ([AssociatedNormAttorney]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Previous page of results if applicable. - total_pages (int): Total no. of pages. - total_count (int): Total no. of results for this criteria. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssociatedNormAttorneyResponse from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AssociatedNormAttorneyResponse', + "associatedNormAttorneyArray": [AssociatedNormAttorney.from_dict(_item) for _item in obj["associatedNormAttorneyArray"]] if obj.get("associatedNormAttorneyArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.associated_norm_attorney_array = associated_norm_attorney_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/associated_norm_judge.py b/unicourt/model/associated_norm_judge.py index 072ac75..59efc95 100644 --- a/unicourt/model/associated_norm_judge.py +++ b/unicourt/model/associated_norm_judge.py @@ -1,365 +1,117 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_timeline import CaseTimeline - globals()['CaseTimeline'] = CaseTimeline - - -class AssociatedNormJudge(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 19, - }, - ('norm_judge_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('norm_judge_api',): { - 'max_length': 255, - }, - ('name',): { - 'max_length': 500, - }, - ('first_name',): { - 'max_length': 500, - }, - ('middle_name',): { - 'max_length': 500, - }, - ('last_name',): { - 'max_length': 500, - }, - ('case_search_api',): { - 'max_length': 255, - }, - ('version',): { - 'max_length': 7, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_judge_id': (str,), # noqa: E501 - 'norm_judge_api': (str,), # noqa: E501 - 'case_timeline': (CaseTimeline,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'first_name': (str,), # noqa: E501 - 'middle_name': (str, none_type,), # noqa: E501 - 'last_name': (str,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'version': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_judge_id': 'normJudgeId', # noqa: E501 - 'norm_judge_api': 'normJudgeAPI', # noqa: E501 - 'case_timeline': 'caseTimeline', # noqa: E501 - 'name': 'name', # noqa: E501 - 'first_name': 'firstName', # noqa: E501 - 'middle_name': 'middleName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'version': 'version', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_timeline import CaseTimeline +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class AssociatedNormJudge(BaseModel): + """ + Associated Judge + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=19)]] = 'AssociatedNormJudge' + norm_judge_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normJudgeId") + norm_judge_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to Details from the Judge.", alias="normJudgeAPI") + case_timeline: Optional[CaseTimeline] = Field(default=None, alias="caseTimeline") + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + first_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="firstName") + middle_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="middleName") + last_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="lastName") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to related cases for this association.", alias="caseSearchAPI") + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + version: Optional[Annotated[str, Field(strict=True, max_length=7)]] = None + __properties: ClassVar[List[str]] = ["object", "normJudgeId", "normJudgeAPI", "caseTimeline", "name", "firstName", "middleName", "lastName", "caseSearchAPI", "caseCount", "version"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_judge_id, norm_judge_api, case_timeline, name, first_name, middle_name, last_name, case_search_api, case_count, version, *args, **kwargs): # noqa: E501 - """AssociatedNormJudge - a model defined in OpenAPI - - Args: - norm_judge_id (str): - norm_judge_api (str): Link to Details from the Judge. - case_timeline (CaseTimeline): - name (str): - first_name (str): - middle_name (str, none_type): - last_name (str): - case_search_api (str): Link to related cases for this association. - case_count (int): - version (str): - - Keyword Args: - object (str): defaults to "AssociatedNormJudge" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AssociatedNormJudge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssociatedNormJudge from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_judge_id = norm_judge_id - self.norm_judge_api = norm_judge_api - self.case_timeline = case_timeline - self.name = name - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.case_search_api = case_search_api - self.case_count = case_count - self.version = version - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_judge_id, norm_judge_api, case_timeline, name, first_name, middle_name, last_name, case_search_api, case_count, version, *args, **kwargs): # noqa: E501 - """AssociatedNormJudge - a model defined in OpenAPI - - Args: - norm_judge_id (str): - norm_judge_api (str): Link to Details from the Judge. - case_timeline (CaseTimeline): - name (str): - first_name (str): - middle_name (str, none_type): - last_name (str): - case_search_api (str): Link to related cases for this association. - case_count (int): - version (str): - - Keyword Args: - object (str): defaults to "AssociatedNormJudge" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_timeline + if self.case_timeline: + _dict['caseTimeline'] = self.case_timeline.to_dict() + # set to None if middle_name (nullable) is None + # and model_fields_set contains the field + if self.middle_name is None and "middle_name" in self.model_fields_set: + _dict['middleName'] = None + + return _dict - object = kwargs.get('object', "AssociatedNormJudge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssociatedNormJudge from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AssociatedNormJudge', + "normJudgeId": obj.get("normJudgeId"), + "normJudgeAPI": obj.get("normJudgeAPI"), + "caseTimeline": CaseTimeline.from_dict(obj["caseTimeline"]) if obj.get("caseTimeline") is not None else None, + "name": obj.get("name"), + "firstName": obj.get("firstName"), + "middleName": obj.get("middleName"), + "lastName": obj.get("lastName"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseCount": obj.get("caseCount"), + "version": obj.get("version") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_judge_id = norm_judge_id - self.norm_judge_api = norm_judge_api - self.case_timeline = case_timeline - self.name = name - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.case_search_api = case_search_api - self.case_count = case_count - self.version = version - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/associated_norm_judge_response.py b/unicourt/model/associated_norm_judge_response.py index 90a04e8..c64b93f 100644 --- a/unicourt/model/associated_norm_judge_response.py +++ b/unicourt/model/associated_norm_judge_response.py @@ -1,305 +1,116 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.associated_norm_judge import AssociatedNormJudge - globals()['AssociatedNormJudge'] = AssociatedNormJudge +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class AssociatedNormJudgeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.associated_norm_judge import AssociatedNormJudge +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class AssociatedNormJudgeResponse(BaseModel): """ + AssociatedNormJudgeResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=27)]] = 'AssociatedNormJudgeResponse' + associated_norm_judge_array: Optional[List[AssociatedNormJudge]] = Field(default=None, alias="associatedNormJudgeArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Previous page of results if applicable.", alias="previousPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total no. of results for this criteria.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "associatedNormJudgeArray", "nextPageAPI", "previousPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssociatedNormJudgeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'associated_norm_judge_array': ([AssociatedNormJudge],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'associated_norm_judge_array': 'associatedNormJudgeArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in associated_norm_judge_array (list) + _items = [] + if self.associated_norm_judge_array: + for _item in self.associated_norm_judge_array: + if _item: + _items.append(_item.to_dict()) + _dict['associatedNormJudgeArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, associated_norm_judge_array, next_page_api, previous_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """AssociatedNormJudgeResponse - a model defined in OpenAPI - - Args: - associated_norm_judge_array ([AssociatedNormJudge]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Previous page of results if applicable. - total_pages (int): Total no. of pages. - total_count (int): Total no. of results for this criteria. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.associated_norm_judge_array = associated_norm_judge_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, associated_norm_judge_array, next_page_api, previous_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """AssociatedNormJudgeResponse - a model defined in OpenAPI - - Args: - associated_norm_judge_array ([AssociatedNormJudge]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Previous page of results if applicable. - total_pages (int): Total no. of pages. - total_count (int): Total no. of results for this criteria. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssociatedNormJudgeResponse from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AssociatedNormJudgeResponse', + "associatedNormJudgeArray": [AssociatedNormJudge.from_dict(_item) for _item in obj["associatedNormJudgeArray"]] if obj.get("associatedNormJudgeArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.associated_norm_judge_array = associated_norm_judge_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/associated_norm_law_firm.py b/unicourt/model/associated_norm_law_firm.py index 323f1dd..9078a92 100644 --- a/unicourt/model/associated_norm_law_firm.py +++ b/unicourt/model/associated_norm_law_firm.py @@ -1,337 +1,114 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_timeline import CaseTimeline - from unicourt.model.sos_data_preview import SOSDataPreview - globals()['CaseTimeline'] = CaseTimeline - globals()['SOSDataPreview'] = SOSDataPreview - - -class AssociatedNormLawFirm(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 21, - }, - ('norm_law_firm_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('norm_law_firm_api',): { - 'max_length': 255, - }, - ('name',): { - 'max_length': 500, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_law_firm_id': (str,), # noqa: E501 - 'norm_law_firm_api': (str,), # noqa: E501 - 'case_timeline': (CaseTimeline,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'sos_data_array': ([SOSDataPreview],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_law_firm_id': 'normLawFirmId', # noqa: E501 - 'norm_law_firm_api': 'normLawFirmAPI', # noqa: E501 - 'case_timeline': 'caseTimeline', # noqa: E501 - 'name': 'name', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'sos_data_array': 'sosDataArray', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_timeline import CaseTimeline +from unicourt.model.sos_data_preview import SOSDataPreview +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class AssociatedNormLawFirm(BaseModel): + """ + AssociatedNormLawFirm + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=21)]] = 'AssociatedNormLawFirm' + norm_law_firm_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normLawFirmId") + norm_law_firm_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to Details for this Law Firm.", alias="normLawFirmAPI") + case_timeline: Optional[CaseTimeline] = Field(default=None, alias="caseTimeline") + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to related cases for this association.", alias="caseSearchAPI") + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + sos_data_array: Optional[List[SOSDataPreview]] = Field(default=None, alias="sosDataArray") + __properties: ClassVar[List[str]] = ["object", "normLawFirmId", "normLawFirmAPI", "caseTimeline", "name", "caseSearchAPI", "caseCount", "sosDataArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_law_firm_id, norm_law_firm_api, case_timeline, name, case_search_api, case_count, sos_data_array, *args, **kwargs): # noqa: E501 - """AssociatedNormLawFirm - a model defined in OpenAPI - - Args: - norm_law_firm_id (str): - norm_law_firm_api (str): Link to Details for this Law Firm. - case_timeline (CaseTimeline): - name (str): - case_search_api (str): Link to related cases for this association. - case_count (int): - sos_data_array ([SOSDataPreview]): - - Keyword Args: - object (str): defaults to "AssociatedNormLawFirm" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AssociatedNormLawFirm") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssociatedNormLawFirm from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_law_firm_id = norm_law_firm_id - self.norm_law_firm_api = norm_law_firm_api - self.case_timeline = case_timeline - self.name = name - self.case_search_api = case_search_api - self.case_count = case_count - self.sos_data_array = sos_data_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_law_firm_id, norm_law_firm_api, case_timeline, name, case_search_api, case_count, sos_data_array, *args, **kwargs): # noqa: E501 - """AssociatedNormLawFirm - a model defined in OpenAPI - - Args: - norm_law_firm_id (str): - norm_law_firm_api (str): Link to Details for this Law Firm. - case_timeline (CaseTimeline): - name (str): - case_search_api (str): Link to related cases for this association. - case_count (int): - sos_data_array ([SOSDataPreview]): - - Keyword Args: - object (str): defaults to "AssociatedNormLawFirm" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_timeline + if self.case_timeline: + _dict['caseTimeline'] = self.case_timeline.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in sos_data_array (list) + _items = [] + if self.sos_data_array: + for _item in self.sos_data_array: + if _item: + _items.append(_item.to_dict()) + _dict['sosDataArray'] = _items + return _dict - object = kwargs.get('object', "AssociatedNormLawFirm") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssociatedNormLawFirm from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AssociatedNormLawFirm', + "normLawFirmId": obj.get("normLawFirmId"), + "normLawFirmAPI": obj.get("normLawFirmAPI"), + "caseTimeline": CaseTimeline.from_dict(obj["caseTimeline"]) if obj.get("caseTimeline") is not None else None, + "name": obj.get("name"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseCount": obj.get("caseCount"), + "sosDataArray": [SOSDataPreview.from_dict(_item) for _item in obj["sosDataArray"]] if obj.get("sosDataArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_law_firm_id = norm_law_firm_id - self.norm_law_firm_api = norm_law_firm_api - self.case_timeline = case_timeline - self.name = name - self.case_search_api = case_search_api - self.case_count = case_count - self.sos_data_array = sos_data_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/associated_norm_law_firm_response.py b/unicourt/model/associated_norm_law_firm_response.py index 6849680..534d238 100644 --- a/unicourt/model/associated_norm_law_firm_response.py +++ b/unicourt/model/associated_norm_law_firm_response.py @@ -1,305 +1,116 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.associated_norm_law_firm import AssociatedNormLawFirm - globals()['AssociatedNormLawFirm'] = AssociatedNormLawFirm +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class AssociatedNormLawFirmResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.associated_norm_law_firm import AssociatedNormLawFirm +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class AssociatedNormLawFirmResponse(BaseModel): """ + AssociatedNormLawFirmResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=29)]] = 'AssociatedNormLawFirmResponse' + associated_norm_law_firm_array: Optional[List[AssociatedNormLawFirm]] = Field(default=None, alias="associatedNormLawFirmArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total no. of results for this criteria.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "associatedNormLawFirmArray", "nextPageAPI", "previousPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssociatedNormLawFirmResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'associated_norm_law_firm_array': ([AssociatedNormLawFirm],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'associated_norm_law_firm_array': 'associatedNormLawFirmArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in associated_norm_law_firm_array (list) + _items = [] + if self.associated_norm_law_firm_array: + for _item in self.associated_norm_law_firm_array: + if _item: + _items.append(_item.to_dict()) + _dict['associatedNormLawFirmArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, associated_norm_law_firm_array, next_page_api, previous_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """AssociatedNormLawFirmResponse - a model defined in OpenAPI - - Args: - associated_norm_law_firm_array ([AssociatedNormLawFirm]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - total_pages (int): Total no. of pages. - total_count (int): Total no. of results for this criteria. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.associated_norm_law_firm_array = associated_norm_law_firm_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, associated_norm_law_firm_array, next_page_api, previous_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """AssociatedNormLawFirmResponse - a model defined in OpenAPI - - Args: - associated_norm_law_firm_array ([AssociatedNormLawFirm]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - total_pages (int): Total no. of pages. - total_count (int): Total no. of results for this criteria. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssociatedNormLawFirmResponse from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AssociatedNormLawFirmResponse', + "associatedNormLawFirmArray": [AssociatedNormLawFirm.from_dict(_item) for _item in obj["associatedNormLawFirmArray"]] if obj.get("associatedNormLawFirmArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.associated_norm_law_firm_array = associated_norm_law_firm_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/associated_norm_party.py b/unicourt/model/associated_norm_party.py index 5a7d41e..7cd121b 100644 --- a/unicourt/model/associated_norm_party.py +++ b/unicourt/model/associated_norm_party.py @@ -1,337 +1,114 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_timeline import CaseTimeline - from unicourt.model.sos_data_preview import SOSDataPreview - globals()['CaseTimeline'] = CaseTimeline - globals()['SOSDataPreview'] = SOSDataPreview - - -class AssociatedNormParty(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 19, - }, - ('norm_party_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('norm_party_api',): { - 'max_length': 255, - }, - ('name',): { - 'max_length': 500, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_party_id': (str,), # noqa: E501 - 'norm_party_api': (str,), # noqa: E501 - 'case_timeline': (CaseTimeline,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'sos_data_array': ([SOSDataPreview],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_party_id': 'normPartyId', # noqa: E501 - 'norm_party_api': 'normPartyAPI', # noqa: E501 - 'case_timeline': 'caseTimeline', # noqa: E501 - 'name': 'name', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'sos_data_array': 'sosDataArray', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_timeline import CaseTimeline +from unicourt.model.sos_data_preview import SOSDataPreview +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class AssociatedNormParty(BaseModel): + """ + AssociatedNormParty + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=19)]] = 'AssociatedNormParty' + norm_party_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normPartyId") + norm_party_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to Details for the Party.", alias="normPartyAPI") + case_timeline: Optional[CaseTimeline] = Field(default=None, alias="caseTimeline") + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to related cases for this association.", alias="caseSearchAPI") + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + sos_data_array: Optional[List[SOSDataPreview]] = Field(default=None, alias="sosDataArray") + __properties: ClassVar[List[str]] = ["object", "normPartyId", "normPartyAPI", "caseTimeline", "name", "caseSearchAPI", "caseCount", "sosDataArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_party_id, norm_party_api, case_timeline, name, case_search_api, case_count, sos_data_array, *args, **kwargs): # noqa: E501 - """AssociatedNormParty - a model defined in OpenAPI - - Args: - norm_party_id (str): - norm_party_api (str): Link to Details for the Party. - case_timeline (CaseTimeline): - name (str): - case_search_api (str): Link to related cases for this association. - case_count (int): - sos_data_array ([SOSDataPreview]): - - Keyword Args: - object (str): defaults to "AssociatedNormParty" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AssociatedNormParty") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssociatedNormParty from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_party_id = norm_party_id - self.norm_party_api = norm_party_api - self.case_timeline = case_timeline - self.name = name - self.case_search_api = case_search_api - self.case_count = case_count - self.sos_data_array = sos_data_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_party_id, norm_party_api, case_timeline, name, case_search_api, case_count, sos_data_array, *args, **kwargs): # noqa: E501 - """AssociatedNormParty - a model defined in OpenAPI - - Args: - norm_party_id (str): - norm_party_api (str): Link to Details for the Party. - case_timeline (CaseTimeline): - name (str): - case_search_api (str): Link to related cases for this association. - case_count (int): - sos_data_array ([SOSDataPreview]): - - Keyword Args: - object (str): defaults to "AssociatedNormParty" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_timeline + if self.case_timeline: + _dict['caseTimeline'] = self.case_timeline.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in sos_data_array (list) + _items = [] + if self.sos_data_array: + for _item in self.sos_data_array: + if _item: + _items.append(_item.to_dict()) + _dict['sosDataArray'] = _items + return _dict - object = kwargs.get('object', "AssociatedNormParty") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssociatedNormParty from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AssociatedNormParty', + "normPartyId": obj.get("normPartyId"), + "normPartyAPI": obj.get("normPartyAPI"), + "caseTimeline": CaseTimeline.from_dict(obj["caseTimeline"]) if obj.get("caseTimeline") is not None else None, + "name": obj.get("name"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseCount": obj.get("caseCount"), + "sosDataArray": [SOSDataPreview.from_dict(_item) for _item in obj["sosDataArray"]] if obj.get("sosDataArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_party_id = norm_party_id - self.norm_party_api = norm_party_api - self.case_timeline = case_timeline - self.name = name - self.case_search_api = case_search_api - self.case_count = case_count - self.sos_data_array = sos_data_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/associated_norm_party_response.py b/unicourt/model/associated_norm_party_response.py index 96a95ce..d67b5f0 100644 --- a/unicourt/model/associated_norm_party_response.py +++ b/unicourt/model/associated_norm_party_response.py @@ -1,305 +1,116 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.associated_norm_party import AssociatedNormParty - globals()['AssociatedNormParty'] = AssociatedNormParty +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class AssociatedNormPartyResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.associated_norm_party import AssociatedNormParty +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class AssociatedNormPartyResponse(BaseModel): """ + AssociatedNormPartyResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=27)]] = 'AssociatedNormPartyResponse' + associated_norm_party_array: Optional[List[AssociatedNormParty]] = Field(default=None, alias="associatedNormPartyArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total no. of results for this criteria.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "associatedNormPartyArray", "nextPageAPI", "previousPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssociatedNormPartyResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'associated_norm_party_array': ([AssociatedNormParty],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'associated_norm_party_array': 'associatedNormPartyArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in associated_norm_party_array (list) + _items = [] + if self.associated_norm_party_array: + for _item in self.associated_norm_party_array: + if _item: + _items.append(_item.to_dict()) + _dict['associatedNormPartyArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, associated_norm_party_array, next_page_api, previous_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """AssociatedNormPartyResponse - a model defined in OpenAPI - - Args: - associated_norm_party_array ([AssociatedNormParty]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - total_pages (int): Total no. of pages. - total_count (int): Total no. of results for this criteria. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.associated_norm_party_array = associated_norm_party_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, associated_norm_party_array, next_page_api, previous_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """AssociatedNormPartyResponse - a model defined in OpenAPI - - Args: - associated_norm_party_array ([AssociatedNormParty]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - total_pages (int): Total no. of pages. - total_count (int): Total no. of results for this criteria. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssociatedNormPartyResponse from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AssociatedNormPartyResponse', + "associatedNormPartyArray": [AssociatedNormParty.from_dict(_item) for _item in obj["associatedNormPartyArray"]] if obj.get("associatedNormPartyArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.associated_norm_party_array = associated_norm_party_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/associated_so_s_person.py b/unicourt/model/associated_so_s_person.py index d9b3407..025b727 100644 --- a/unicourt/model/associated_so_s_person.py +++ b/unicourt/model/associated_so_s_person.py @@ -1,311 +1,108 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.contact import Contact - globals()['Contact'] = Contact +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class AssociatedSoSPerson(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.contact import Contact +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class AssociatedSoSPerson(BaseModel): """ + AssociatedSoSPerson + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=19)]] = 'AssociatedSoSPerson' + contact: Optional[Contact] = None + entity_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="entityName") + entity_type: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, alias="entityType") + __properties: ClassVar[List[str]] = ["object", "contact", "entityName", "entityType"] + + @field_validator('entity_type') + def entity_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Partner', 'Agent', 'CEO', 'Partner/General Member', 'Partner/GeneralMember']): + raise ValueError("must be one of enum values ('Partner', 'Agent', 'CEO', 'Partner/General Member', 'Partner/GeneralMember')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('entity_type',): { - 'PARTNER': "Partner", - 'AGENT': "Agent", - 'CEO': "CEO", - 'PARTNER/GENERAL_MEMBER': "Partner/General Member", - 'PARTNER/GENERALMEMBER': "Partner/GeneralMember", - }, - } - - validations = { - ('object',): { - 'max_length': 19, - }, - ('entity_name',): { - 'max_length': 500, - }, - ('entity_type',): { - 'max_length': 50, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssociatedSoSPerson from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'contact': (Contact,), # noqa: E501 - 'entity_name': (str,), # noqa: E501 - 'entity_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'contact': 'contact', # noqa: E501 - 'entity_name': 'entityName', # noqa: E501 - 'entity_type': 'entityType', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of contact + if self.contact: + _dict['contact'] = self.contact.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, contact, entity_name, entity_type, *args, **kwargs): # noqa: E501 - """AssociatedSoSPerson - a model defined in OpenAPI - - Args: - contact (Contact): - entity_name (str): - entity_type (str): - - Keyword Args: - object (str): defaults to "AssociatedSoSPerson" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AssociatedSoSPerson") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.contact = contact - self.entity_name = entity_name - self.entity_type = entity_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, contact, entity_name, entity_type, *args, **kwargs): # noqa: E501 - """AssociatedSoSPerson - a model defined in OpenAPI - - Args: - contact (Contact): - entity_name (str): - entity_type (str): - - Keyword Args: - object (str): defaults to "AssociatedSoSPerson" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssociatedSoSPerson from a dict""" + if obj is None: + return None - object = kwargs.get('object', "AssociatedSoSPerson") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AssociatedSoSPerson', + "contact": Contact.from_dict(obj["contact"]) if obj.get("contact") is not None else None, + "entityName": obj.get("entityName"), + "entityType": obj.get("entityType") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.contact = contact - self.entity_name = entity_name - self.entity_type = entity_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/attorney.py b/unicourt/model/attorney.py index 5615735..d08f65e 100644 --- a/unicourt/model/attorney.py +++ b/unicourt/model/attorney.py @@ -1,451 +1,195 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.attorney_law_firm import AttorneyLawFirm - from unicourt.model.attorney_type import AttorneyType - from unicourt.model.contact import Contact - from unicourt.model.party_attorney_associations import PartyAttorneyAssociations - from unicourt.model.possible_norm_attorney import PossibleNormAttorney - from unicourt.model.possible_norm_law_firm import PossibleNormLawFirm - globals()['AttorneyLawFirm'] = AttorneyLawFirm - globals()['AttorneyType'] = AttorneyType - globals()['Contact'] = Contact - globals()['PartyAttorneyAssociations'] = PartyAttorneyAssociations - globals()['PossibleNormAttorney'] = PossibleNormAttorney - globals()['PossibleNormLawFirm'] = PossibleNormLawFirm - - -class Attorney(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 8, - 'min_length': 8, - }, - ('attorney_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 250, - 'min_length': 1, - }, - ('name_prefix',): { - 'max_length': 10, - }, - ('first_name',): { - 'max_length': 250, - }, - ('middle_name',): { - 'max_length': 100, - }, - ('last_name',): { - 'max_length': 100, - }, - ('name_suffix',): { - 'max_length': 10, - }, - ('attorney_law_firm_array',): { - 'max_items': 25, - }, - ('bar_number',): { - 'max_length': 250, - }, - ('source_attorney_type',): { - 'max_length': 250, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'attorney_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'name_prefix': (str, none_type,), # noqa: E501 - 'first_name': (str, none_type,), # noqa: E501 - 'middle_name': (str, none_type,), # noqa: E501 - 'last_name': (str, none_type,), # noqa: E501 - 'name_suffix': (str, none_type,), # noqa: E501 - 'contact': (Contact,), # noqa: E501 - 'attorney_law_firm_array': ([AttorneyLawFirm],), # noqa: E501 - 'bar_number': (str, none_type,), # noqa: E501 - 'attorney_type': (AttorneyType,), # noqa: E501 - 'source_attorney_type': (str,), # noqa: E501 - 'is_visible': (bool,), # noqa: E501 - 'first_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date': (datetime,), # noqa: E501 - 'party_attorney_associations': (PartyAttorneyAssociations,), # noqa: E501 - 'possible_norm_attorney_array': ([PossibleNormAttorney],), # noqa: E501 - 'possible_norm_law_firm_array': ([PossibleNormLawFirm],), # noqa: E501 - 'party_role_group_id_array': ([str],), # noqa: E501 - 'party_role_id_array': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'attorney_id': 'attorneyId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'name_prefix': 'namePrefix', # noqa: E501 - 'first_name': 'firstName', # noqa: E501 - 'middle_name': 'middleName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - 'name_suffix': 'nameSuffix', # noqa: E501 - 'contact': 'contact', # noqa: E501 - 'attorney_law_firm_array': 'attorneyLawFirmArray', # noqa: E501 - 'bar_number': 'barNumber', # noqa: E501 - 'attorney_type': 'attorneyType', # noqa: E501 - 'source_attorney_type': 'sourceAttorneyType', # noqa: E501 - 'is_visible': 'isVisible', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'party_attorney_associations': 'partyAttorneyAssociations', # noqa: E501 - 'possible_norm_attorney_array': 'possibleNormAttorneyArray', # noqa: E501 - 'possible_norm_law_firm_array': 'possibleNormLawFirmArray', # noqa: E501 - 'party_role_group_id_array': 'partyRoleGroupIdArray', # noqa: E501 - 'party_role_id_array': 'partyRoleIdArray', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.attorney_law_firm import AttorneyLawFirm +from unicourt.model.attorney_type import AttorneyType +from unicourt.model.contact import Contact +from unicourt.model.party_attorney_associations import PartyAttorneyAssociations +from unicourt.model.possible_norm_attorney import PossibleNormAttorney +from unicourt.model.possible_norm_law_firm import PossibleNormLawFirm +from typing import Optional, Set +from typing_extensions import Self + +class Attorney(BaseModel): + """ + Attorney + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=8, strict=True, max_length=8)]] = Field(default='Attorney', description="Name of the object") + attorney_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="ID for the attorney in this case. This ID is unique within a case and NOT across cases. If the same attorney were to appear in another case this ID would be different.", alias="attorneyId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=250)]] = Field(default=None, description="Name of the attorney as provided by Court.") + name_prefix: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, alias="namePrefix") + first_name: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="First name of the attorney. This is normalized by UniCourt.", alias="firstName") + middle_name: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Middle name of the attorney. This is normalized by UniCourt.", alias="middleName") + last_name: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Last name of the attorney. This is normalized by UniCourt.", alias="lastName") + name_suffix: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, alias="nameSuffix") + contact: Optional[Contact] = None + attorney_law_firm_array: Optional[Annotated[List[AttorneyLawFirm], Field(max_length=25)]] = Field(default=None, alias="attorneyLawFirmArray") + bar_number: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="The bar enrollment number of an attorney.", alias="barNumber") + attorney_type: Optional[AttorneyType] = Field(default=None, alias="attorneyType") + source_attorney_type: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="Attorney Type as provided by Court.", alias="sourceAttorneyType") + is_visible: Optional[StrictBool] = Field(default=None, description="Signifies if the attorney as this attorney type is currently isVisible or not for the case.", alias="isVisible") + first_fetch_date: Optional[datetime] = Field(default=None, description="When was the attorney first fetched from the court site.", alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, description="When was the attorney last fetched from the court site.", alias="lastFetchDate") + party_attorney_associations: Optional[PartyAttorneyAssociations] = Field(default=None, alias="partyAttorneyAssociations") + possible_norm_attorney_array: Optional[List[PossibleNormAttorney]] = Field(default=None, alias="possibleNormAttorneyArray") + possible_norm_law_firm_array: Optional[List[PossibleNormLawFirm]] = Field(default=None, description="Possible Norm Lawfirm array for a Attorney.", alias="possibleNormLawFirmArray") + party_role_group_id_array: Optional[List[Annotated[str, Field(min_length=18, strict=True, max_length=18)]]] = Field(default=None, description="Party Role Group Id for a Attorney.", alias="partyRoleGroupIdArray") + party_role_id_array: Optional[List[Annotated[str, Field(min_length=18, strict=True, max_length=18)]]] = Field(default=None, description="Party Role Id for a Attorney.", alias="partyRoleIdArray") + __properties: ClassVar[List[str]] = ["object", "attorneyId", "name", "namePrefix", "firstName", "middleName", "lastName", "nameSuffix", "contact", "attorneyLawFirmArray", "barNumber", "attorneyType", "sourceAttorneyType", "isVisible", "firstFetchDate", "lastFetchDate", "partyAttorneyAssociations", "possibleNormAttorneyArray", "possibleNormLawFirmArray", "partyRoleGroupIdArray", "partyRoleIdArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, attorney_id, name, name_prefix, first_name, middle_name, last_name, name_suffix, contact, attorney_law_firm_array, bar_number, attorney_type, source_attorney_type, is_visible, first_fetch_date, last_fetch_date, party_attorney_associations, possible_norm_attorney_array, possible_norm_law_firm_array, party_role_group_id_array, party_role_id_array, *args, **kwargs): # noqa: E501 - """Attorney - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Attorney from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - attorney_id (str): ID for the attorney in this case. This ID is unique within a case and NOT across cases. If the same attorney were to appear in another case this ID would be different. - name (str): Name of the attorney as provided by Court. - name_prefix (str, none_type): - first_name (str, none_type): First name of the attorney. This is normalized by UniCourt. - middle_name (str, none_type): Middle name of the attorney. This is normalized by UniCourt. - last_name (str, none_type): Last name of the attorney. This is normalized by UniCourt. - name_suffix (str, none_type): - contact (Contact): - attorney_law_firm_array ([AttorneyLawFirm]): - bar_number (str, none_type): The bar enrollment number of an attorney. - attorney_type (AttorneyType): - source_attorney_type (str): Attorney Type as provided by Court. - is_visible (bool): Signifies if the attorney as this attorney type is currently isVisible or not for the case. - first_fetch_date (datetime): When was the attorney first fetched from the court site. - last_fetch_date (datetime): When was the attorney last fetched from the court site. - party_attorney_associations (PartyAttorneyAssociations): - possible_norm_attorney_array ([PossibleNormAttorney]): - possible_norm_law_firm_array ([PossibleNormLawFirm]): Possible Norm Lawfirm array for a Attorney. - party_role_group_id_array ([str]): Party Role Group Id for a Attorney. - party_role_id_array ([str]): Party Role Id for a Attorney. - - Keyword Args: - object (str): Name of the object. defaults to "Attorney" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "Attorney") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.attorney_id = attorney_id - self.name = name - self.name_prefix = name_prefix - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.name_suffix = name_suffix - self.contact = contact - self.attorney_law_firm_array = attorney_law_firm_array - self.bar_number = bar_number - self.attorney_type = attorney_type - self.source_attorney_type = source_attorney_type - self.is_visible = is_visible - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.party_attorney_associations = party_attorney_associations - self.possible_norm_attorney_array = possible_norm_attorney_array - self.possible_norm_law_firm_array = possible_norm_law_firm_array - self.party_role_group_id_array = party_role_group_id_array - self.party_role_id_array = party_role_id_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, attorney_id, name, name_prefix, first_name, middle_name, last_name, name_suffix, contact, attorney_law_firm_array, bar_number, attorney_type, source_attorney_type, is_visible, first_fetch_date, last_fetch_date, party_attorney_associations, possible_norm_attorney_array, possible_norm_law_firm_array, party_role_group_id_array, party_role_id_array, *args, **kwargs): # noqa: E501 - """Attorney - a model defined in OpenAPI - - Args: - attorney_id (str): ID for the attorney in this case. This ID is unique within a case and NOT across cases. If the same attorney were to appear in another case this ID would be different. - name (str): Name of the attorney as provided by Court. - name_prefix (str, none_type): - first_name (str, none_type): First name of the attorney. This is normalized by UniCourt. - middle_name (str, none_type): Middle name of the attorney. This is normalized by UniCourt. - last_name (str, none_type): Last name of the attorney. This is normalized by UniCourt. - name_suffix (str, none_type): - contact (Contact): - attorney_law_firm_array ([AttorneyLawFirm]): - bar_number (str, none_type): The bar enrollment number of an attorney. - attorney_type (AttorneyType): - source_attorney_type (str): Attorney Type as provided by Court. - is_visible (bool): Signifies if the attorney as this attorney type is currently isVisible or not for the case. - first_fetch_date (datetime): When was the attorney first fetched from the court site. - last_fetch_date (datetime): When was the attorney last fetched from the court site. - party_attorney_associations (PartyAttorneyAssociations): - possible_norm_attorney_array ([PossibleNormAttorney]): - possible_norm_law_firm_array ([PossibleNormLawFirm]): Possible Norm Lawfirm array for a Attorney. - party_role_group_id_array ([str]): Party Role Group Id for a Attorney. - party_role_id_array ([str]): Party Role Id for a Attorney. - - Keyword Args: - object (str): Name of the object. defaults to "Attorney" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of contact + if self.contact: + _dict['contact'] = self.contact.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in attorney_law_firm_array (list) + _items = [] + if self.attorney_law_firm_array: + for _item in self.attorney_law_firm_array: + if _item: + _items.append(_item.to_dict()) + _dict['attorneyLawFirmArray'] = _items + # override the default output from pydantic by calling `to_dict()` of attorney_type + if self.attorney_type: + _dict['attorneyType'] = self.attorney_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of party_attorney_associations + if self.party_attorney_associations: + _dict['partyAttorneyAssociations'] = self.party_attorney_associations.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in possible_norm_attorney_array (list) + _items = [] + if self.possible_norm_attorney_array: + for _item in self.possible_norm_attorney_array: + if _item: + _items.append(_item.to_dict()) + _dict['possibleNormAttorneyArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in possible_norm_law_firm_array (list) + _items = [] + if self.possible_norm_law_firm_array: + for _item in self.possible_norm_law_firm_array: + if _item: + _items.append(_item.to_dict()) + _dict['possibleNormLawFirmArray'] = _items + # set to None if name_prefix (nullable) is None + # and model_fields_set contains the field + if self.name_prefix is None and "name_prefix" in self.model_fields_set: + _dict['namePrefix'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['firstName'] = None + + # set to None if middle_name (nullable) is None + # and model_fields_set contains the field + if self.middle_name is None and "middle_name" in self.model_fields_set: + _dict['middleName'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['lastName'] = None + + # set to None if name_suffix (nullable) is None + # and model_fields_set contains the field + if self.name_suffix is None and "name_suffix" in self.model_fields_set: + _dict['nameSuffix'] = None + + # set to None if bar_number (nullable) is None + # and model_fields_set contains the field + if self.bar_number is None and "bar_number" in self.model_fields_set: + _dict['barNumber'] = None + + return _dict - object = kwargs.get('object', "Attorney") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Attorney from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Attorney', + "attorneyId": obj.get("attorneyId"), + "name": obj.get("name"), + "namePrefix": obj.get("namePrefix"), + "firstName": obj.get("firstName"), + "middleName": obj.get("middleName"), + "lastName": obj.get("lastName"), + "nameSuffix": obj.get("nameSuffix"), + "contact": Contact.from_dict(obj["contact"]) if obj.get("contact") is not None else None, + "attorneyLawFirmArray": [AttorneyLawFirm.from_dict(_item) for _item in obj["attorneyLawFirmArray"]] if obj.get("attorneyLawFirmArray") is not None else None, + "barNumber": obj.get("barNumber"), + "attorneyType": AttorneyType.from_dict(obj["attorneyType"]) if obj.get("attorneyType") is not None else None, + "sourceAttorneyType": obj.get("sourceAttorneyType"), + "isVisible": obj.get("isVisible"), + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate"), + "partyAttorneyAssociations": PartyAttorneyAssociations.from_dict(obj["partyAttorneyAssociations"]) if obj.get("partyAttorneyAssociations") is not None else None, + "possibleNormAttorneyArray": [PossibleNormAttorney.from_dict(_item) for _item in obj["possibleNormAttorneyArray"]] if obj.get("possibleNormAttorneyArray") is not None else None, + "possibleNormLawFirmArray": [PossibleNormLawFirm.from_dict(_item) for _item in obj["possibleNormLawFirmArray"]] if obj.get("possibleNormLawFirmArray") is not None else None, + "partyRoleGroupIdArray": obj.get("partyRoleGroupIdArray"), + "partyRoleIdArray": obj.get("partyRoleIdArray") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.attorney_id = attorney_id - self.name = name - self.name_prefix = name_prefix - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.name_suffix = name_suffix - self.contact = contact - self.attorney_law_firm_array = attorney_law_firm_array - self.bar_number = bar_number - self.attorney_type = attorney_type - self.source_attorney_type = source_attorney_type - self.is_visible = is_visible - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.party_attorney_associations = party_attorney_associations - self.possible_norm_attorney_array = possible_norm_attorney_array - self.possible_norm_law_firm_array = possible_norm_law_firm_array - self.party_role_group_id_array = party_role_group_id_array - self.party_role_id_array = party_role_id_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/attorney_analytics_api.py b/unicourt/model/attorney_analytics_api.py index c6d1f65..7b1d5d5 100644 --- a/unicourt/model/attorney_analytics_api.py +++ b/unicourt/model/attorney_analytics_api.py @@ -1,337 +1,112 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class AttorneyAnalyticsAPI(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 20, - }, - ('norm_attorney_api',): { - 'max_length': 255, - }, - ('associated_norm_judges_api',): { - 'max_length': 255, - }, - ('associated_norm_law_firms_api',): { - 'max_length': 255, - }, - ('associated_norm_parties_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_opposing_norm_attorney_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_opposing_norm_law_firm_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_opposing_norm_party_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'norm_attorney_api': (str,), # noqa: E501 - 'associated_norm_judges_api': (str,), # noqa: E501 - 'associated_norm_law_firms_api': (str,), # noqa: E501 - 'associated_norm_parties_api': (str,), # noqa: E501 - 'case_count_analytics_by_opposing_norm_attorney_api': (str,), # noqa: E501 - 'case_count_analytics_by_opposing_norm_law_firm_api': (str, none_type,), # noqa: E501 - 'case_count_analytics_by_opposing_norm_party_api': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_attorney_api': 'normAttorneyAPI', # noqa: E501 - 'associated_norm_judges_api': 'associatedNormJudgesAPI', # noqa: E501 - 'associated_norm_law_firms_api': 'associatedNormLawFirmsAPI', # noqa: E501 - 'associated_norm_parties_api': 'associatedNormPartiesAPI', # noqa: E501 - 'case_count_analytics_by_opposing_norm_attorney_api': 'caseCountAnalyticsByOpposingNormAttorneyAPI', # noqa: E501 - 'case_count_analytics_by_opposing_norm_law_firm_api': 'caseCountAnalyticsByOpposingNormLawFirmAPI', # noqa: E501 - 'case_count_analytics_by_opposing_norm_party_api': 'caseCountAnalyticsByOpposingNormPartyAPI', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class AttorneyAnalyticsAPI(BaseModel): + """ + AttorneyAnalyticsAPI + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=20)]] = 'AttorneyAnalyticsAPI' + norm_attorney_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to Details for the Attorney.", alias="normAttorneyAPI") + associated_norm_judges_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormJudgesAPI") + associated_norm_law_firms_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormLawFirmsAPI") + associated_norm_parties_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormPartiesAPI") + case_count_analytics_by_opposing_norm_attorney_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByOpposingNormAttorneyAPI") + case_count_analytics_by_opposing_norm_law_firm_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByOpposingNormLawFirmAPI") + case_count_analytics_by_opposing_norm_party_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByOpposingNormPartyAPI") + __properties: ClassVar[List[str]] = ["object", "normAttorneyAPI", "associatedNormJudgesAPI", "associatedNormLawFirmsAPI", "associatedNormPartiesAPI", "caseCountAnalyticsByOpposingNormAttorneyAPI", "caseCountAnalyticsByOpposingNormLawFirmAPI", "caseCountAnalyticsByOpposingNormPartyAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_attorney_api, associated_norm_judges_api, associated_norm_law_firms_api, associated_norm_parties_api, case_count_analytics_by_opposing_norm_attorney_api, case_count_analytics_by_opposing_norm_law_firm_api, case_count_analytics_by_opposing_norm_party_api, *args, **kwargs): # noqa: E501 - """AttorneyAnalyticsAPI - a model defined in OpenAPI - - Args: - norm_attorney_api (str): Link to Details for the Attorney. - associated_norm_judges_api (str): - associated_norm_law_firms_api (str): - associated_norm_parties_api (str): - case_count_analytics_by_opposing_norm_attorney_api (str): - case_count_analytics_by_opposing_norm_law_firm_api (str, none_type): - case_count_analytics_by_opposing_norm_party_api (str, none_type): - - Keyword Args: - object (str): defaults to "AttorneyAnalyticsAPI" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AttorneyAnalyticsAPI from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "AttorneyAnalyticsAPI") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_attorney_api = norm_attorney_api - self.associated_norm_judges_api = associated_norm_judges_api - self.associated_norm_law_firms_api = associated_norm_law_firms_api - self.associated_norm_parties_api = associated_norm_parties_api - self.case_count_analytics_by_opposing_norm_attorney_api = case_count_analytics_by_opposing_norm_attorney_api - self.case_count_analytics_by_opposing_norm_law_firm_api = case_count_analytics_by_opposing_norm_law_firm_api - self.case_count_analytics_by_opposing_norm_party_api = case_count_analytics_by_opposing_norm_party_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_attorney_api, associated_norm_judges_api, associated_norm_law_firms_api, associated_norm_parties_api, case_count_analytics_by_opposing_norm_attorney_api, case_count_analytics_by_opposing_norm_law_firm_api, case_count_analytics_by_opposing_norm_party_api, *args, **kwargs): # noqa: E501 - """AttorneyAnalyticsAPI - a model defined in OpenAPI - - Args: - norm_attorney_api (str): Link to Details for the Attorney. - associated_norm_judges_api (str): - associated_norm_law_firms_api (str): - associated_norm_parties_api (str): - case_count_analytics_by_opposing_norm_attorney_api (str): - case_count_analytics_by_opposing_norm_law_firm_api (str, none_type): - case_count_analytics_by_opposing_norm_party_api (str, none_type): - - Keyword Args: - object (str): defaults to "AttorneyAnalyticsAPI" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if case_count_analytics_by_opposing_norm_law_firm_api (nullable) is None + # and model_fields_set contains the field + if self.case_count_analytics_by_opposing_norm_law_firm_api is None and "case_count_analytics_by_opposing_norm_law_firm_api" in self.model_fields_set: + _dict['caseCountAnalyticsByOpposingNormLawFirmAPI'] = None + + # set to None if case_count_analytics_by_opposing_norm_party_api (nullable) is None + # and model_fields_set contains the field + if self.case_count_analytics_by_opposing_norm_party_api is None and "case_count_analytics_by_opposing_norm_party_api" in self.model_fields_set: + _dict['caseCountAnalyticsByOpposingNormPartyAPI'] = None + + return _dict - object = kwargs.get('object', "AttorneyAnalyticsAPI") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AttorneyAnalyticsAPI from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AttorneyAnalyticsAPI', + "normAttorneyAPI": obj.get("normAttorneyAPI"), + "associatedNormJudgesAPI": obj.get("associatedNormJudgesAPI"), + "associatedNormLawFirmsAPI": obj.get("associatedNormLawFirmsAPI"), + "associatedNormPartiesAPI": obj.get("associatedNormPartiesAPI"), + "caseCountAnalyticsByOpposingNormAttorneyAPI": obj.get("caseCountAnalyticsByOpposingNormAttorneyAPI"), + "caseCountAnalyticsByOpposingNormLawFirmAPI": obj.get("caseCountAnalyticsByOpposingNormLawFirmAPI"), + "caseCountAnalyticsByOpposingNormPartyAPI": obj.get("caseCountAnalyticsByOpposingNormPartyAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_attorney_api = norm_attorney_api - self.associated_norm_judges_api = associated_norm_judges_api - self.associated_norm_law_firms_api = associated_norm_law_firms_api - self.associated_norm_parties_api = associated_norm_parties_api - self.case_count_analytics_by_opposing_norm_attorney_api = case_count_analytics_by_opposing_norm_attorney_api - self.case_count_analytics_by_opposing_norm_law_firm_api = case_count_analytics_by_opposing_norm_law_firm_api - self.case_count_analytics_by_opposing_norm_party_api = case_count_analytics_by_opposing_norm_party_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/attorney_law_firm.py b/unicourt/model/attorney_law_firm.py index 703c476..66473eb 100644 --- a/unicourt/model/attorney_law_firm.py +++ b/unicourt/model/attorney_law_firm.py @@ -1,321 +1,103 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class AttorneyLawFirm(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class AttorneyLawFirm(BaseModel): """ + Name of the attorney's law firm as provided by Court. This can be null as some Courts do not provide this as a separate field. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=15, strict=True, max_length=15)]] = Field(default='AttorneyLawFirm', description="Name of the object") + attorney_law_firm_id: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=18)]] = Field(default=None, description="ID for the law firm of an attorney in this case. This ID is unique within a case and NOT across cases. If the same attorney were to appear in another case this ID would be different.", alias="attorneyLawFirmId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=250)]] = Field(default=None, description="Name of the law firm as provided by Court.") + is_visible: Optional[StrictBool] = Field(default=None, description="Signifies if the attorney as this attorney type is currently isVisible or not for the case.", alias="isVisible") + first_fetch_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="Is the date when the document was first fetched from the court site.", alias="firstFetchDate") + last_fetch_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="Is the date when the document was last fetched from the court site.", alias="lastFetchDate") + __properties: ClassVar[List[str]] = ["object", "attorneyLawFirmId", "name", "isVisible", "firstFetchDate", "lastFetchDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 15, - 'min_length': 15, - }, - ('attorney_law_firm_id',): { - 'max_length': 18, - 'min_length': 17, - }, - ('name',): { - 'max_length': 250, - 'min_length': 1, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AttorneyLawFirm from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'attorney_law_firm_id': (str, none_type,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'is_visible': (bool,), # noqa: E501 - 'first_fetch_date': (str,), # noqa: E501 - 'last_fetch_date': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if attorney_law_firm_id (nullable) is None + # and model_fields_set contains the field + if self.attorney_law_firm_id is None and "attorney_law_firm_id" in self.model_fields_set: + _dict['attorneyLawFirmId'] = None - attribute_map = { - 'object': 'object', # noqa: E501 - 'attorney_law_firm_id': 'attorneyLawFirmId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'is_visible': 'isVisible', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, attorney_law_firm_id, name, is_visible, first_fetch_date, last_fetch_date, *args, **kwargs): # noqa: E501 - """AttorneyLawFirm - a model defined in OpenAPI - - Args: - attorney_law_firm_id (str, none_type): ID for the law firm of an attorney in this case. This ID is unique within a case and NOT across cases. If the same attorney were to appear in another case this ID would be different. - name (str): Name of the law firm as provided by Court. - is_visible (bool): Signifies if the attorney as this attorney type is currently isVisible or not for the case. - first_fetch_date (str): Is the date when the document was first fetched from the court site. - last_fetch_date (str): Is the date when the document was last fetched from the court site. - - Keyword Args: - object (str): Name of the object. defaults to "AttorneyLawFirm" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AttorneyLawFirm") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.attorney_law_firm_id = attorney_law_firm_id - self.name = name - self.is_visible = is_visible - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, attorney_law_firm_id, name, is_visible, first_fetch_date, last_fetch_date, *args, **kwargs): # noqa: E501 - """AttorneyLawFirm - a model defined in OpenAPI - - Args: - attorney_law_firm_id (str, none_type): ID for the law firm of an attorney in this case. This ID is unique within a case and NOT across cases. If the same attorney were to appear in another case this ID would be different. - name (str): Name of the law firm as provided by Court. - is_visible (bool): Signifies if the attorney as this attorney type is currently isVisible or not for the case. - first_fetch_date (str): Is the date when the document was first fetched from the court site. - last_fetch_date (str): Is the date when the document was last fetched from the court site. - - Keyword Args: - object (str): Name of the object. defaults to "AttorneyLawFirm" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AttorneyLawFirm from a dict""" + if obj is None: + return None - object = kwargs.get('object', "AttorneyLawFirm") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AttorneyLawFirm', + "attorneyLawFirmId": obj.get("attorneyLawFirmId"), + "name": obj.get("name"), + "isVisible": obj.get("isVisible"), + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.attorney_law_firm_id = attorney_law_firm_id - self.name = name - self.is_visible = is_visible - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/attorney_representation_type.py b/unicourt/model/attorney_representation_type.py index 3476c2f..4b6534b 100644 --- a/unicourt/model/attorney_representation_type.py +++ b/unicourt/model/attorney_representation_type.py @@ -1,305 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class AttorneyRepresentationType(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class AttorneyRepresentationType(BaseModel): """ + AttorneyRepresentationType + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=26, strict=True, max_length=26)]] = 'AttorneyRepresentationType' + attorney_representation_type_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="attorneyRepresentationTypeId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "attorneyRepresentationTypeId", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 26, - 'min_length': 26, - }, - ('attorney_representation_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AttorneyRepresentationType from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'attorney_representation_type_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'attorney_representation_type_id': 'attorneyRepresentationTypeId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, attorney_representation_type_id, name, created_date, *args, **kwargs): # noqa: E501 - """AttorneyRepresentationType - a model defined in OpenAPI - - Args: - attorney_representation_type_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "AttorneyRepresentationType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AttorneyRepresentationType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.attorney_representation_type_id = attorney_representation_type_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, attorney_representation_type_id, name, created_date, *args, **kwargs): # noqa: E501 - """AttorneyRepresentationType - a model defined in OpenAPI - - Args: - attorney_representation_type_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "AttorneyRepresentationType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AttorneyRepresentationType from a dict""" + if obj is None: + return None - object = kwargs.get('object', "AttorneyRepresentationType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AttorneyRepresentationType', + "attorneyRepresentationTypeId": obj.get("attorneyRepresentationTypeId"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.attorney_representation_type_id = attorney_representation_type_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/attorney_representation_type_response.py b/unicourt/model/attorney_representation_type_response.py index cca6dd7..9a851f4 100644 --- a/unicourt/model/attorney_representation_type_response.py +++ b/unicourt/model/attorney_representation_type_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.attorney_representation_type import AttorneyRepresentationType - globals()['AttorneyRepresentationType'] = AttorneyRepresentationType - - -class AttorneyRepresentationTypeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 34, - 'min_length': 34, - }, - ('attorney_representation_type_array',): { - }, - ('next_page_api',): { - 'max_length': 2159, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2158, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'attorney_representation_type_array': ([AttorneyRepresentationType],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'attorney_representation_type_array': 'attorneyRepresentationTypeArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.attorney_representation_type import AttorneyRepresentationType +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class AttorneyRepresentationTypeResponse(BaseModel): + """ + AttorneyRepresentationTypeResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=34, strict=True, max_length=34)]] = 'AttorneyRepresentationTypeResponse' + attorney_representation_type_array: Optional[List[AttorneyRepresentationType]] = Field(default=None, alias="attorneyRepresentationTypeArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2159)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2158)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "attorneyRepresentationTypeArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, attorney_representation_type_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """AttorneyRepresentationTypeResponse - a model defined in OpenAPI - - Args: - attorney_representation_type_array ([AttorneyRepresentationType]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "AttorneyRepresentationTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AttorneyRepresentationTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AttorneyRepresentationTypeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.attorney_representation_type_array = attorney_representation_type_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, attorney_representation_type_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """AttorneyRepresentationTypeResponse - a model defined in OpenAPI - - Args: - attorney_representation_type_array ([AttorneyRepresentationType]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "AttorneyRepresentationTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in attorney_representation_type_array (list) + _items = [] + if self.attorney_representation_type_array: + for _item in self.attorney_representation_type_array: + if _item: + _items.append(_item.to_dict()) + _dict['attorneyRepresentationTypeArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "AttorneyRepresentationTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AttorneyRepresentationTypeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AttorneyRepresentationTypeResponse', + "attorneyRepresentationTypeArray": [AttorneyRepresentationType.from_dict(_item) for _item in obj["attorneyRepresentationTypeArray"]] if obj.get("attorneyRepresentationTypeArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.attorney_representation_type_array = attorney_representation_type_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/attorney_type.py b/unicourt/model/attorney_type.py index d475c71..258cbf6 100644 --- a/unicourt/model/attorney_type.py +++ b/unicourt/model/attorney_type.py @@ -1,305 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class AttorneyType(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class AttorneyType(BaseModel): """ + AttorneyType + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=12, strict=True, max_length=12)]] = 'AttorneyType' + attorney_type_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="attorneyTypeId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "attorneyTypeId", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 12, - 'min_length': 12, - }, - ('attorney_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AttorneyType from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'attorney_type_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'attorney_type_id': 'attorneyTypeId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, attorney_type_id, name, created_date, *args, **kwargs): # noqa: E501 - """AttorneyType - a model defined in OpenAPI - - Args: - attorney_type_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "AttorneyType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AttorneyType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.attorney_type_id = attorney_type_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, attorney_type_id, name, created_date, *args, **kwargs): # noqa: E501 - """AttorneyType - a model defined in OpenAPI - - Args: - attorney_type_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "AttorneyType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AttorneyType from a dict""" + if obj is None: + return None - object = kwargs.get('object', "AttorneyType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AttorneyType', + "attorneyTypeId": obj.get("attorneyTypeId"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.attorney_type_id = attorney_type_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/attorney_type_response.py b/unicourt/model/attorney_type_response.py index 862913d..333aaa4 100644 --- a/unicourt/model/attorney_type_response.py +++ b/unicourt/model/attorney_type_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.attorney_type import AttorneyType - globals()['AttorneyType'] = AttorneyType - - -class AttorneyTypeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 20, - 'min_length': 20, - }, - ('attorney_type_array',): { - }, - ('next_page_api',): { - 'max_length': 2145, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2144, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'attorney_type_array': ([AttorneyType],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'attorney_type_array': 'attorneyTypeArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.attorney_type import AttorneyType +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class AttorneyTypeResponse(BaseModel): + """ + AttorneyTypeResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=20, strict=True, max_length=20)]] = 'AttorneyTypeResponse' + attorney_type_array: Optional[List[AttorneyType]] = Field(default=None, alias="attorneyTypeArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2145)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2144)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "attorneyTypeArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, attorney_type_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """AttorneyTypeResponse - a model defined in OpenAPI - - Args: - attorney_type_array ([AttorneyType]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "AttorneyTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "AttorneyTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AttorneyTypeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.attorney_type_array = attorney_type_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, attorney_type_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """AttorneyTypeResponse - a model defined in OpenAPI - - Args: - attorney_type_array ([AttorneyType]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "AttorneyTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in attorney_type_array (list) + _items = [] + if self.attorney_type_array: + for _item in self.attorney_type_array: + if _item: + _items.append(_item.to_dict()) + _dict['attorneyTypeArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "AttorneyTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AttorneyTypeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'AttorneyTypeResponse', + "attorneyTypeArray": [AttorneyType.from_dict(_item) for _item in obj["attorneyTypeArray"]] if obj.get("attorneyTypeArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.attorney_type_array = attorney_type_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/attorneys.py b/unicourt/model/attorneys.py index a11a7ae..f1b50c8 100644 --- a/unicourt/model/attorneys.py +++ b/unicourt/model/attorneys.py @@ -1,317 +1,111 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.attorney import Attorney - globals()['Attorney'] = Attorney +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class Attorneys(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.attorney import Attorney +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class Attorneys(BaseModel): """ + Attorneys + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]] = Field(default='Attorneys', description="Name of the object") + page_number: Optional[StrictInt] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + attorney_array: Optional[Annotated[List[Attorney], Field(max_length=25)]] = Field(default=None, alias="attorneyArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to next page of a particular entity in a Case.", alias="nextPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects of a party in the Case.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of parties of the Case entity in a Case.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "pageNumber", "attorneyArray", "nextPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 9, - 'min_length': 9, - }, - ('attorney_array',): { - 'max_items': 25, - }, - ('next_page_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Attorneys from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'attorney_array': ([Attorney],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'attorney_array': 'attorneyArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in attorney_array (list) + _items = [] + if self.attorney_array: + for _item in self.attorney_array: + if _item: + _items.append(_item.to_dict()) + _dict['attorneyArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, page_number, attorney_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """Attorneys - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - attorney_array ([Attorney]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "Attorneys" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "Attorneys") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.page_number = page_number - self.attorney_array = attorney_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, page_number, attorney_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """Attorneys - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - attorney_array ([Attorney]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "Attorneys" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Attorneys from a dict""" + if obj is None: + return None - object = kwargs.get('object', "Attorneys") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Attorneys', + "pageNumber": obj.get("pageNumber"), + "attorneyArray": [Attorney.from_dict(_item) for _item in obj["attorneyArray"]] if obj.get("attorneyArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.page_number = page_number - self.attorney_array = attorney_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_record.py b/unicourt/model/bar_record.py index 4af671e..9fed3cf 100644 --- a/unicourt/model/bar_record.py +++ b/unicourt/model/bar_record.py @@ -1,381 +1,144 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.bar_source_data import BarSourceData - from unicourt.model.contact import Contact - globals()['BarSourceData'] = BarSourceData - globals()['Contact'] = Contact - - -class BarRecord(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('status',): { - 'ACTIVE': "Active", - 'INACTIVE': "Inactive", - 'NOT_CLASSIFIED': "Not Classified", - 'UNKNOWN': "Unknown", - }, - } - - validations = { - ('object',): { - 'max_length': 9, - }, - ('bar_number',): { - 'max_length': 250, - }, - ('bar_source_type',): { - 'max_length': 70, - }, - ('admitted_date',): { - 'max_length': 25, - }, - ('state_code',): { - 'max_length': 2, - }, - ('status',): { - 'max_length': 15, - }, - ('inactivation_date',): { - 'max_length': 25, - }, - ('first_fetch_date',): { - 'max_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - }, - ('last_fetch_date_with_updates',): { - 'max_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'bar_number': (str, none_type,), # noqa: E501 - 'bar_source_type': (str,), # noqa: E501 - 'admitted_date': (datetime, none_type,), # noqa: E501 - 'state_code': (str,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'inactivation_date': (datetime, none_type,), # noqa: E501 - 'bar_source_data': (BarSourceData,), # noqa: E501 - 'contact': (Contact,), # noqa: E501 - 'first_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date_with_updates': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'bar_number': 'barNumber', # noqa: E501 - 'bar_source_type': 'barSourceType', # noqa: E501 - 'admitted_date': 'admittedDate', # noqa: E501 - 'state_code': 'stateCode', # noqa: E501 - 'status': 'status', # noqa: E501 - 'inactivation_date': 'inactivationDate', # noqa: E501 - 'bar_source_data': 'barSourceData', # noqa: E501 - 'contact': 'contact', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'last_fetch_date_with_updates': 'lastFetchDateWithUpdates', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.bar_source_data import BarSourceData +from unicourt.model.contact import Contact +from typing import Optional, Set +from typing_extensions import Self + +class BarRecord(BaseModel): + """ + This contains the Attorney details that is obtained from the State Bar where the attorney is registered. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=9)]] = 'BarRecord' + bar_number: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="barNumber") + bar_source_type: Optional[Annotated[str, Field(strict=True, max_length=70)]] = Field(default=None, alias="barSourceType") + admitted_date: Optional[datetime] = Field(default=None, description="The admittedDate is the date when an attorney was admitted to the bar of a given state.", alias="admittedDate") + state_code: Optional[Annotated[str, Field(strict=True, max_length=2)]] = Field(default=None, alias="stateCode") + status: Optional[Annotated[str, Field(strict=True, max_length=15)]] = None + inactivation_date: Optional[datetime] = Field(default=None, alias="inactivationDate") + bar_source_data: Optional[BarSourceData] = Field(default=None, alias="barSourceData") + contact: Optional[Contact] = None + first_fetch_date: Optional[datetime] = Field(default=None, alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, alias="lastFetchDate") + last_fetch_date_with_updates: Optional[datetime] = Field(default=None, description="Last Fetch Date of the Attorney Update.", alias="lastFetchDateWithUpdates") + __properties: ClassVar[List[str]] = ["object", "barNumber", "barSourceType", "admittedDate", "stateCode", "status", "inactivationDate", "barSourceData", "contact", "firstFetchDate", "lastFetchDate", "lastFetchDateWithUpdates"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Active', 'Inactive', 'Not Classified', 'Unknown']): + raise ValueError("must be one of enum values ('Active', 'Inactive', 'Not Classified', 'Unknown')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, bar_number, bar_source_type, admitted_date, state_code, status, inactivation_date, bar_source_data, contact, first_fetch_date, last_fetch_date, last_fetch_date_with_updates, *args, **kwargs): # noqa: E501 - """BarRecord - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarRecord from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - bar_number (str, none_type): - bar_source_type (str): - admitted_date (datetime, none_type): The admittedDate is the date when an attorney was admitted to the bar of a given state. - state_code (str): - status (str): - inactivation_date (datetime, none_type): - bar_source_data (BarSourceData): - contact (Contact): - first_fetch_date (datetime): - last_fetch_date (datetime): - last_fetch_date_with_updates (datetime): Last Fetch Date of the Attorney Update. - - Keyword Args: - object (str): defaults to "BarRecord" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "BarRecord") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.bar_number = bar_number - self.bar_source_type = bar_source_type - self.admitted_date = admitted_date - self.state_code = state_code - self.status = status - self.inactivation_date = inactivation_date - self.bar_source_data = bar_source_data - self.contact = contact - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.last_fetch_date_with_updates = last_fetch_date_with_updates - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, bar_number, bar_source_type, admitted_date, state_code, status, inactivation_date, bar_source_data, contact, first_fetch_date, last_fetch_date, last_fetch_date_with_updates, *args, **kwargs): # noqa: E501 - """BarRecord - a model defined in OpenAPI - - Args: - bar_number (str, none_type): - bar_source_type (str): - admitted_date (datetime, none_type): The admittedDate is the date when an attorney was admitted to the bar of a given state. - state_code (str): - status (str): - inactivation_date (datetime, none_type): - bar_source_data (BarSourceData): - contact (Contact): - first_fetch_date (datetime): - last_fetch_date (datetime): - last_fetch_date_with_updates (datetime): Last Fetch Date of the Attorney Update. - - Keyword Args: - object (str): defaults to "BarRecord" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of bar_source_data + if self.bar_source_data: + _dict['barSourceData'] = self.bar_source_data.to_dict() + # override the default output from pydantic by calling `to_dict()` of contact + if self.contact: + _dict['contact'] = self.contact.to_dict() + # set to None if bar_number (nullable) is None + # and model_fields_set contains the field + if self.bar_number is None and "bar_number" in self.model_fields_set: + _dict['barNumber'] = None + + # set to None if admitted_date (nullable) is None + # and model_fields_set contains the field + if self.admitted_date is None and "admitted_date" in self.model_fields_set: + _dict['admittedDate'] = None + + # set to None if inactivation_date (nullable) is None + # and model_fields_set contains the field + if self.inactivation_date is None and "inactivation_date" in self.model_fields_set: + _dict['inactivationDate'] = None + + return _dict - object = kwargs.get('object', "BarRecord") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarRecord from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'BarRecord', + "barNumber": obj.get("barNumber"), + "barSourceType": obj.get("barSourceType"), + "admittedDate": obj.get("admittedDate"), + "stateCode": obj.get("stateCode"), + "status": obj.get("status"), + "inactivationDate": obj.get("inactivationDate"), + "barSourceData": BarSourceData.from_dict(obj["barSourceData"]) if obj.get("barSourceData") is not None else None, + "contact": Contact.from_dict(obj["contact"]) if obj.get("contact") is not None else None, + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate"), + "lastFetchDateWithUpdates": obj.get("lastFetchDateWithUpdates") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.bar_number = bar_number - self.bar_source_type = bar_source_type - self.admitted_date = admitted_date - self.state_code = state_code - self.status = status - self.inactivation_date = inactivation_date - self.bar_source_data = bar_source_data - self.contact = contact - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.last_fetch_date_with_updates = last_fetch_date_with_updates - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_record_preview.py b/unicourt/model/bar_record_preview.py index 60352f3..f678cfa 100644 --- a/unicourt/model/bar_record_preview.py +++ b/unicourt/model/bar_record_preview.py @@ -1,301 +1,104 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class BarRecordPreview(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class BarRecordPreview(BaseModel): """ + BarRecordPreview + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=16)]] = 'BarRecordPreview' + bar_source_type: Optional[Annotated[str, Field(strict=True, max_length=70)]] = Field(default=None, alias="barSourceType") + bar_number: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="barNumber") + state_code: Optional[Annotated[str, Field(strict=True, max_length=2)]] = Field(default=None, alias="stateCode") + __properties: ClassVar[List[str]] = ["object", "barSourceType", "barNumber", "stateCode"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 16, - }, - ('bar_source_type',): { - 'max_length': 70, - }, - ('bar_number',): { - 'max_length': 250, - }, - ('state_code',): { - 'max_length': 2, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarRecordPreview from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'bar_source_type': (str, none_type,), # noqa: E501 - 'bar_number': (str, none_type,), # noqa: E501 - 'state_code': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'bar_source_type': 'barSourceType', # noqa: E501 - 'bar_number': 'barNumber', # noqa: E501 - 'state_code': 'stateCode', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if bar_source_type (nullable) is None + # and model_fields_set contains the field + if self.bar_source_type is None and "bar_source_type" in self.model_fields_set: + _dict['barSourceType'] = None + + # set to None if bar_number (nullable) is None + # and model_fields_set contains the field + if self.bar_number is None and "bar_number" in self.model_fields_set: + _dict['barNumber'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, bar_source_type, bar_number, state_code, *args, **kwargs): # noqa: E501 - """BarRecordPreview - a model defined in OpenAPI - - Args: - bar_source_type (str, none_type): - bar_number (str, none_type): - state_code (str): - - Keyword Args: - object (str): defaults to "BarRecordPreview" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "BarRecordPreview") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.bar_source_type = bar_source_type - self.bar_number = bar_number - self.state_code = state_code - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, bar_source_type, bar_number, state_code, *args, **kwargs): # noqa: E501 - """BarRecordPreview - a model defined in OpenAPI - - Args: - bar_source_type (str, none_type): - bar_number (str, none_type): - state_code (str): - - Keyword Args: - object (str): defaults to "BarRecordPreview" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarRecordPreview from a dict""" + if obj is None: + return None - object = kwargs.get('object', "BarRecordPreview") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'BarRecordPreview', + "barSourceType": obj.get("barSourceType"), + "barNumber": obj.get("barNumber"), + "stateCode": obj.get("stateCode") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.bar_source_type = bar_source_type - self.bar_number = bar_number - self.state_code = state_code - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data.py b/unicourt/model/bar_source_data.py index c60cb5e..a47a5a1 100644 --- a/unicourt/model/bar_source_data.py +++ b/unicourt/model/bar_source_data.py @@ -1,843 +1,575 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.bar_source_data_administrative_actions_array_inner import BarSourceDataAdministrativeActionsArrayInner - from unicourt.model.bar_source_data_advanced_degree_array_inner import BarSourceDataAdvancedDegreeArrayInner - from unicourt.model.bar_source_data_bar_status_array_inner import BarSourceDataBarStatusArrayInner - from unicourt.model.bar_source_data_board_certifications_array_inner import BarSourceDataBoardCertificationsArrayInner - from unicourt.model.bar_source_data_committees_array_inner import BarSourceDataCommitteesArrayInner - from unicourt.model.bar_source_data_court_history_array_inner import BarSourceDataCourtHistoryArrayInner - from unicourt.model.bar_source_data_court_of_admissions import BarSourceDataCourtOfAdmissions - from unicourt.model.bar_source_data_disciplinary_history_array_inner import BarSourceDataDisciplinaryHistoryArrayInner - from unicourt.model.bar_source_data_discipline_summaries_array_inner import BarSourceDataDisciplineSummariesArrayInner - from unicourt.model.bar_source_data_employment_history_array_inner import BarSourceDataEmploymentHistoryArrayInner - from unicourt.model.bar_source_data_fees_options_array_inner import BarSourceDataFeesOptionsArrayInner - from unicourt.model.bar_source_data_involvements_array_inner import BarSourceDataInvolvementsArrayInner - from unicourt.model.bar_source_data_law_school_array_inner import BarSourceDataLawSchoolArrayInner - from unicourt.model.bar_source_data_name import BarSourceDataName - from unicourt.model.bar_source_data_open_action_status_array_inner import BarSourceDataOpenActionStatusArrayInner - from unicourt.model.bar_source_data_other_jurisdiction_array_inner import BarSourceDataOtherJurisdictionArrayInner - from unicourt.model.bar_source_data_public_hearing_array_inner import BarSourceDataPublicHearingArrayInner - from unicourt.model.bar_source_data_reason_for_inactivation import BarSourceDataReasonForInactivation - from unicourt.model.bar_source_data_related_cases_array_inner import BarSourceDataRelatedCasesArrayInner - from unicourt.model.bar_source_data_source_info import BarSourceDataSourceInfo - from unicourt.model.bar_source_data_statewide_grievance_committee_history_array_inner import BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner - from unicourt.model.bar_source_data_status_history_array_inner import BarSourceDataStatusHistoryArrayInner - from unicourt.model.bar_source_data_ten_year_discipline_array_inner import BarSourceDataTenYearDisciplineArrayInner - globals()['BarSourceDataAdministrativeActionsArrayInner'] = BarSourceDataAdministrativeActionsArrayInner - globals()['BarSourceDataAdvancedDegreeArrayInner'] = BarSourceDataAdvancedDegreeArrayInner - globals()['BarSourceDataBarStatusArrayInner'] = BarSourceDataBarStatusArrayInner - globals()['BarSourceDataBoardCertificationsArrayInner'] = BarSourceDataBoardCertificationsArrayInner - globals()['BarSourceDataCommitteesArrayInner'] = BarSourceDataCommitteesArrayInner - globals()['BarSourceDataCourtHistoryArrayInner'] = BarSourceDataCourtHistoryArrayInner - globals()['BarSourceDataCourtOfAdmissions'] = BarSourceDataCourtOfAdmissions - globals()['BarSourceDataDisciplinaryHistoryArrayInner'] = BarSourceDataDisciplinaryHistoryArrayInner - globals()['BarSourceDataDisciplineSummariesArrayInner'] = BarSourceDataDisciplineSummariesArrayInner - globals()['BarSourceDataEmploymentHistoryArrayInner'] = BarSourceDataEmploymentHistoryArrayInner - globals()['BarSourceDataFeesOptionsArrayInner'] = BarSourceDataFeesOptionsArrayInner - globals()['BarSourceDataInvolvementsArrayInner'] = BarSourceDataInvolvementsArrayInner - globals()['BarSourceDataLawSchoolArrayInner'] = BarSourceDataLawSchoolArrayInner - globals()['BarSourceDataName'] = BarSourceDataName - globals()['BarSourceDataOpenActionStatusArrayInner'] = BarSourceDataOpenActionStatusArrayInner - globals()['BarSourceDataOtherJurisdictionArrayInner'] = BarSourceDataOtherJurisdictionArrayInner - globals()['BarSourceDataPublicHearingArrayInner'] = BarSourceDataPublicHearingArrayInner - globals()['BarSourceDataReasonForInactivation'] = BarSourceDataReasonForInactivation - globals()['BarSourceDataRelatedCasesArrayInner'] = BarSourceDataRelatedCasesArrayInner - globals()['BarSourceDataSourceInfo'] = BarSourceDataSourceInfo - globals()['BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner'] = BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner - globals()['BarSourceDataStatusHistoryArrayInner'] = BarSourceDataStatusHistoryArrayInner - globals()['BarSourceDataTenYearDisciplineArrayInner'] = BarSourceDataTenYearDisciplineArrayInner - - -class BarSourceData(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 + - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.bar_source_data_administrative_actions_array_inner import BarSourceDataAdministrativeActionsArrayInner +from unicourt.model.bar_source_data_advanced_degree_array_inner import BarSourceDataAdvancedDegreeArrayInner +from unicourt.model.bar_source_data_bar_status_array_inner import BarSourceDataBarStatusArrayInner +from unicourt.model.bar_source_data_board_certifications_array_inner import BarSourceDataBoardCertificationsArrayInner +from unicourt.model.bar_source_data_committees_array_inner import BarSourceDataCommitteesArrayInner +from unicourt.model.bar_source_data_court_history_array_inner import BarSourceDataCourtHistoryArrayInner +from unicourt.model.bar_source_data_court_of_admissions import BarSourceDataCourtOfAdmissions +from unicourt.model.bar_source_data_disciplinary_history_array_inner import BarSourceDataDisciplinaryHistoryArrayInner +from unicourt.model.bar_source_data_discipline_summaries_array_inner import BarSourceDataDisciplineSummariesArrayInner +from unicourt.model.bar_source_data_employment_history_array_inner import BarSourceDataEmploymentHistoryArrayInner +from unicourt.model.bar_source_data_fees_options_array_inner import BarSourceDataFeesOptionsArrayInner +from unicourt.model.bar_source_data_involvements_array_inner import BarSourceDataInvolvementsArrayInner +from unicourt.model.bar_source_data_law_school_array_inner import BarSourceDataLawSchoolArrayInner +from unicourt.model.bar_source_data_name import BarSourceDataName +from unicourt.model.bar_source_data_open_action_status_array_inner import BarSourceDataOpenActionStatusArrayInner +from unicourt.model.bar_source_data_other_jurisdiction_array_inner import BarSourceDataOtherJurisdictionArrayInner +from unicourt.model.bar_source_data_public_hearing_array_inner import BarSourceDataPublicHearingArrayInner +from unicourt.model.bar_source_data_reason_for_inactivation import BarSourceDataReasonForInactivation +from unicourt.model.bar_source_data_related_cases_array_inner import BarSourceDataRelatedCasesArrayInner +from unicourt.model.bar_source_data_source_info import BarSourceDataSourceInfo +from unicourt.model.bar_source_data_statewide_grievance_committee_history_array_inner import BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner +from unicourt.model.bar_source_data_status_history_array_inner import BarSourceDataStatusHistoryArrayInner +from unicourt.model.bar_source_data_ten_year_discipline_array_inner import BarSourceDataTenYearDisciplineArrayInner +from typing import Optional, Set +from typing_extensions import Self + +class BarSourceData(BaseModel): """ + BarSourceData + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=13)]] = 'BarSourceData' + administrative_actions_array: Optional[List[BarSourceDataAdministrativeActionsArrayInner]] = Field(default=None, alias="administrativeActionsArray") + admission_type: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="admissionType") + appellate_court_district: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="appellateCourtDistrict") + appellate_division_department: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="appellateDivisionDepartment") + attorney_group: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="attorneyGroup") + authorized: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + bar_service_class: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="barServiceClass") + bio: Optional[Annotated[str, Field(strict=True, max_length=5000)]] = None + board_certifications_array: Optional[List[BarSourceDataBoardCertificationsArrayInner]] = Field(default=None, alias="boardCertificationsArray") + board_district: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="boardDistrict") + circuit: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + comments: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + committees_array: Optional[List[BarSourceDataCommitteesArrayInner]] = Field(default=None, alias="committeesArray") + court_history_array: Optional[List[BarSourceDataCourtHistoryArrayInner]] = Field(default=None, alias="courtHistoryArray") + court_of_admissions: Optional[BarSourceDataCourtOfAdmissions] = Field(default=None, alias="courtOfAdmissions") + court_service_email: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="courtServiceEmail") + disciplinary_history_array: Optional[List[BarSourceDataDisciplinaryHistoryArrayInner]] = Field(default=None, alias="disciplinaryHistoryArray") + discipline_summaries_array: Optional[List[BarSourceDataDisciplineSummariesArrayInner]] = Field(default=None, alias="disciplineSummariesArray") + dismissals_array: Optional[List[Annotated[str, Field(strict=True, max_length=250)]]] = Field(default=None, alias="dismissalsArray") + district: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + employment_history_array: Optional[List[BarSourceDataEmploymentHistoryArrayInner]] = Field(default=None, alias="employmentHistoryArray") + expiration_date: Optional[datetime] = Field(default=None, alias="expirationDate") + fees_options_array: Optional[List[BarSourceDataFeesOptionsArrayInner]] = Field(default=None, alias="feesOptionsArray") + firm_size: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="firmSize") + firm_website: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, alias="firmWebsite") + first_admitted_date: Optional[datetime] = Field(default=None, description="The firstAdmittedDate is the date when an attorney was admitted to the bar for the very first time regardless of which U.S state.", alias="firstAdmittedDate") + first_admitted_year: Optional[StrictInt] = Field(default=None, alias="firstAdmittedYear") + home_county: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="homeCounty") + in_good_standing: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="inGoodStanding") + insurance: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + involvements_array: Optional[List[BarSourceDataInvolvementsArrayInner]] = Field(default=None, alias="involvementsArray") + judicial_district: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="judicialDistrict") + juris_type: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="jurisType") + languages_array: Optional[List[Annotated[str, Field(strict=True, max_length=1000)]]] = Field(default=None, alias="languagesArray") + last_renewal_date: Optional[datetime] = Field(default=None, alias="lastRenewalDate") + law_school_array: Optional[List[BarSourceDataLawSchoolArrayInner]] = Field(default=None, alias="lawSchoolArray") + legal_speciality_array: Optional[List[Annotated[str, Field(strict=True, max_length=250)]]] = Field(default=None, alias="legalSpecialityArray") + license_type: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="licenseType") + name: Optional[BarSourceDataName] = None + next_registration: Optional[datetime] = Field(default=None, alias="nextRegistration") + next_renewal_date: Optional[datetime] = Field(default=None, alias="nextRenewalDate") + open_action_status_array: Optional[List[BarSourceDataOpenActionStatusArrayInner]] = Field(default=None, alias="openActionStatusArray") + other_jurisdiction_array: Optional[List[BarSourceDataOtherJurisdictionArrayInner]] = Field(default=None, alias="otherJurisdictionArray") + other_name_array: Optional[List[Annotated[str, Field(strict=True, max_length=500)]]] = Field(default=None, alias="otherNameArray") + parish: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + pending_proceeding_array: Optional[List[Annotated[str, Field(strict=True, max_length=250)]]] = Field(default=None, alias="pendingProceedingArray") + position: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + practice_area_array: Optional[List[Annotated[str, Field(strict=True, max_length=250)]]] = Field(default=None, alias="practiceAreaArray") + practice_location_array: Optional[List[Annotated[str, Field(strict=True, max_length=250)]]] = Field(default=None, alias="practiceLocationArray") + private_law_practice: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="privateLawPractice") + profile_last_certified: Optional[datetime] = Field(default=None, alias="profileLastCertified") + public_hearing_array: Optional[List[BarSourceDataPublicHearingArrayInner]] = Field(default=None, alias="publicHearingArray") + reason_for_inactivation: Optional[BarSourceDataReasonForInactivation] = Field(default=None, alias="reasonForInactivation") + sections_array: Optional[List[Annotated[str, Field(strict=True, max_length=250)]]] = Field(default=None, alias="sectionsArray") + services_array: Optional[List[Annotated[str, Field(strict=True, max_length=250)]]] = Field(default=None, alias="servicesArray") + source_info: Optional[BarSourceDataSourceInfo] = Field(default=None, alias="sourceInfo") + statewide_grievance_committee_history_array: Optional[List[BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner]] = Field(default=None, alias="statewideGrievanceCommitteeHistoryArray") + status: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + status_date: Optional[datetime] = Field(default=None, alias="statusDate") + status_history_array: Optional[List[BarSourceDataStatusHistoryArrayInner]] = Field(default=None, alias="statusHistoryArray") + ten_year_discipline_array: Optional[List[BarSourceDataTenYearDisciplineArrayInner]] = Field(default=None, alias="tenYearDisciplineArray") + undergraduate_school: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="undergraduateSchool") + bar_law_firm: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="barLawFirm") + years_of_practice: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="yearsOfPractice") + clients_represented_array: Optional[List[Annotated[str, Field(strict=True, max_length=250)]]] = Field(default=None, alias="clientsRepresentedArray") + status_hint: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="statusHint") + advanced_degree_array: Optional[List[BarSourceDataAdvancedDegreeArrayInner]] = Field(default=None, alias="advancedDegreeArray") + bar_status_array: Optional[List[BarSourceDataBarStatusArrayInner]] = Field(default=None, alias="barStatusArray") + related_cases_array: Optional[List[BarSourceDataRelatedCasesArrayInner]] = Field(default=None, alias="relatedCasesArray") + __properties: ClassVar[List[str]] = ["object", "administrativeActionsArray", "admissionType", "appellateCourtDistrict", "appellateDivisionDepartment", "attorneyGroup", "authorized", "barServiceClass", "bio", "boardCertificationsArray", "boardDistrict", "circuit", "comments", "committeesArray", "courtHistoryArray", "courtOfAdmissions", "courtServiceEmail", "disciplinaryHistoryArray", "disciplineSummariesArray", "dismissalsArray", "district", "employmentHistoryArray", "expirationDate", "feesOptionsArray", "firmSize", "firmWebsite", "firstAdmittedDate", "firstAdmittedYear", "homeCounty", "inGoodStanding", "insurance", "involvementsArray", "judicialDistrict", "jurisType", "languagesArray", "lastRenewalDate", "lawSchoolArray", "legalSpecialityArray", "licenseType", "name", "nextRegistration", "nextRenewalDate", "openActionStatusArray", "otherJurisdictionArray", "otherNameArray", "parish", "pendingProceedingArray", "position", "practiceAreaArray", "practiceLocationArray", "privateLawPractice", "profileLastCertified", "publicHearingArray", "reasonForInactivation", "sectionsArray", "servicesArray", "sourceInfo", "statewideGrievanceCommitteeHistoryArray", "status", "statusDate", "statusHistoryArray", "tenYearDisciplineArray", "undergraduateSchool", "barLawFirm", "yearsOfPractice", "clientsRepresentedArray", "statusHint", "advancedDegreeArray", "barStatusArray", "relatedCasesArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 13, - }, - ('admission_type',): { - 'max_length': 250, - }, - ('appellate_court_district',): { - 'max_length': 250, - }, - ('appellate_division_department',): { - 'max_length': 250, - }, - ('attorney_group',): { - 'max_length': 250, - }, - ('authorized',): { - 'max_length': 250, - }, - ('bar_service_class',): { - 'max_length': 250, - }, - ('bio',): { - 'max_length': 5000, - }, - ('board_district',): { - 'max_length': 250, - }, - ('circuit',): { - 'max_length': 250, - }, - ('comments',): { - 'max_length': 250, - }, - ('court_service_email',): { - 'max_length': 250, - }, - ('district',): { - 'max_length': 250, - }, - ('expiration_date',): { - 'max_length': 25, - }, - ('firm_size',): { - 'max_length': 250, - }, - ('firm_website',): { - 'max_length': 1000, - }, - ('first_admitted_date',): { - 'max_length': 25, - }, - ('home_county',): { - 'max_length': 250, - }, - ('in_good_standing',): { - 'max_length': 250, - }, - ('insurance',): { - 'max_length': 500, - }, - ('judicial_district',): { - 'max_length': 250, - }, - ('juris_type',): { - 'max_length': 250, - }, - ('last_renewal_date',): { - 'max_length': 25, - }, - ('license_type',): { - 'max_length': 250, - }, - ('next_registration',): { - 'max_length': 25, - }, - ('next_renewal_date',): { - 'max_length': 25, - }, - ('parish',): { - 'max_length': 250, - }, - ('position',): { - 'max_length': 250, - }, - ('private_law_practice',): { - 'max_length': 250, - }, - ('profile_last_certified',): { - 'max_length': 25, - }, - ('status',): { - 'max_length': 500, - }, - ('status_date',): { - 'max_length': 25, - }, - ('undergraduate_school',): { - 'max_length': 250, - }, - ('bar_law_firm',): { - 'max_length': 250, - }, - ('years_of_practice',): { - 'max_length': 250, - }, - ('status_hint',): { - 'max_length': 500, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'administrative_actions_array': ([BarSourceDataAdministrativeActionsArrayInner],), # noqa: E501 - 'admission_type': (str, none_type,), # noqa: E501 - 'appellate_court_district': (str, none_type,), # noqa: E501 - 'appellate_division_department': (str, none_type,), # noqa: E501 - 'attorney_group': (str, none_type,), # noqa: E501 - 'authorized': (str, none_type,), # noqa: E501 - 'bar_service_class': (str, none_type,), # noqa: E501 - 'bio': (str, none_type,), # noqa: E501 - 'board_certifications_array': ([BarSourceDataBoardCertificationsArrayInner],), # noqa: E501 - 'board_district': (str, none_type,), # noqa: E501 - 'circuit': (str, none_type,), # noqa: E501 - 'comments': (str, none_type,), # noqa: E501 - 'committees_array': ([BarSourceDataCommitteesArrayInner],), # noqa: E501 - 'court_history_array': ([BarSourceDataCourtHistoryArrayInner],), # noqa: E501 - 'court_of_admissions': (BarSourceDataCourtOfAdmissions,), # noqa: E501 - 'court_service_email': (str, none_type,), # noqa: E501 - 'disciplinary_history_array': ([BarSourceDataDisciplinaryHistoryArrayInner],), # noqa: E501 - 'discipline_summaries_array': ([BarSourceDataDisciplineSummariesArrayInner],), # noqa: E501 - 'dismissals_array': ([str],), # noqa: E501 - 'district': (str, none_type,), # noqa: E501 - 'employment_history_array': ([BarSourceDataEmploymentHistoryArrayInner],), # noqa: E501 - 'expiration_date': (datetime, none_type,), # noqa: E501 - 'fees_options_array': ([BarSourceDataFeesOptionsArrayInner],), # noqa: E501 - 'firm_size': (str, none_type,), # noqa: E501 - 'firm_website': (str, none_type,), # noqa: E501 - 'first_admitted_date': (datetime, none_type,), # noqa: E501 - 'first_admitted_year': (int, none_type,), # noqa: E501 - 'home_county': (str, none_type,), # noqa: E501 - 'in_good_standing': (str, none_type,), # noqa: E501 - 'insurance': (str, none_type,), # noqa: E501 - 'involvements_array': ([BarSourceDataInvolvementsArrayInner],), # noqa: E501 - 'judicial_district': (str, none_type,), # noqa: E501 - 'juris_type': (str, none_type,), # noqa: E501 - 'languages_array': ([str],), # noqa: E501 - 'last_renewal_date': (datetime, none_type,), # noqa: E501 - 'law_school_array': ([BarSourceDataLawSchoolArrayInner],), # noqa: E501 - 'legal_speciality_array': ([str],), # noqa: E501 - 'license_type': (str, none_type,), # noqa: E501 - 'name': (BarSourceDataName,), # noqa: E501 - 'next_registration': (datetime, none_type,), # noqa: E501 - 'next_renewal_date': (datetime, none_type,), # noqa: E501 - 'open_action_status_array': ([BarSourceDataOpenActionStatusArrayInner],), # noqa: E501 - 'other_jurisdiction_array': ([BarSourceDataOtherJurisdictionArrayInner],), # noqa: E501 - 'other_name_array': ([str],), # noqa: E501 - 'parish': (str, none_type,), # noqa: E501 - 'pending_proceeding_array': ([str],), # noqa: E501 - 'position': (str, none_type,), # noqa: E501 - 'practice_area_array': ([str],), # noqa: E501 - 'practice_location_array': ([str],), # noqa: E501 - 'private_law_practice': (str, none_type,), # noqa: E501 - 'profile_last_certified': (datetime, none_type,), # noqa: E501 - 'public_hearing_array': ([BarSourceDataPublicHearingArrayInner],), # noqa: E501 - 'reason_for_inactivation': (BarSourceDataReasonForInactivation,), # noqa: E501 - 'sections_array': ([str],), # noqa: E501 - 'services_array': ([str],), # noqa: E501 - 'source_info': (BarSourceDataSourceInfo,), # noqa: E501 - 'statewide_grievance_committee_history_array': ([BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner],), # noqa: E501 - 'status': (str, none_type,), # noqa: E501 - 'status_date': (datetime, none_type,), # noqa: E501 - 'status_history_array': ([BarSourceDataStatusHistoryArrayInner],), # noqa: E501 - 'ten_year_discipline_array': ([BarSourceDataTenYearDisciplineArrayInner],), # noqa: E501 - 'undergraduate_school': (str, none_type,), # noqa: E501 - 'bar_law_firm': (str, none_type,), # noqa: E501 - 'years_of_practice': (str, none_type,), # noqa: E501 - 'clients_represented_array': ([str],), # noqa: E501 - 'status_hint': (str, none_type,), # noqa: E501 - 'advanced_degree_array': ([BarSourceDataAdvancedDegreeArrayInner],), # noqa: E501 - 'bar_status_array': ([BarSourceDataBarStatusArrayInner],), # noqa: E501 - 'related_cases_array': ([BarSourceDataRelatedCasesArrayInner],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'administrative_actions_array': 'administrativeActionsArray', # noqa: E501 - 'admission_type': 'admissionType', # noqa: E501 - 'appellate_court_district': 'appellateCourtDistrict', # noqa: E501 - 'appellate_division_department': 'appellateDivisionDepartment', # noqa: E501 - 'attorney_group': 'attorneyGroup', # noqa: E501 - 'authorized': 'authorized', # noqa: E501 - 'bar_service_class': 'barServiceClass', # noqa: E501 - 'bio': 'bio', # noqa: E501 - 'board_certifications_array': 'boardCertificationsArray', # noqa: E501 - 'board_district': 'boardDistrict', # noqa: E501 - 'circuit': 'circuit', # noqa: E501 - 'comments': 'comments', # noqa: E501 - 'committees_array': 'committeesArray', # noqa: E501 - 'court_history_array': 'courtHistoryArray', # noqa: E501 - 'court_of_admissions': 'courtOfAdmissions', # noqa: E501 - 'court_service_email': 'courtServiceEmail', # noqa: E501 - 'disciplinary_history_array': 'disciplinaryHistoryArray', # noqa: E501 - 'discipline_summaries_array': 'disciplineSummariesArray', # noqa: E501 - 'dismissals_array': 'dismissalsArray', # noqa: E501 - 'district': 'district', # noqa: E501 - 'employment_history_array': 'employmentHistoryArray', # noqa: E501 - 'expiration_date': 'expirationDate', # noqa: E501 - 'fees_options_array': 'feesOptionsArray', # noqa: E501 - 'firm_size': 'firmSize', # noqa: E501 - 'firm_website': 'firmWebsite', # noqa: E501 - 'first_admitted_date': 'firstAdmittedDate', # noqa: E501 - 'first_admitted_year': 'firstAdmittedYear', # noqa: E501 - 'home_county': 'homeCounty', # noqa: E501 - 'in_good_standing': 'inGoodStanding', # noqa: E501 - 'insurance': 'insurance', # noqa: E501 - 'involvements_array': 'involvementsArray', # noqa: E501 - 'judicial_district': 'judicialDistrict', # noqa: E501 - 'juris_type': 'jurisType', # noqa: E501 - 'languages_array': 'languagesArray', # noqa: E501 - 'last_renewal_date': 'lastRenewalDate', # noqa: E501 - 'law_school_array': 'lawSchoolArray', # noqa: E501 - 'legal_speciality_array': 'legalSpecialityArray', # noqa: E501 - 'license_type': 'licenseType', # noqa: E501 - 'name': 'name', # noqa: E501 - 'next_registration': 'nextRegistration', # noqa: E501 - 'next_renewal_date': 'nextRenewalDate', # noqa: E501 - 'open_action_status_array': 'openActionStatusArray', # noqa: E501 - 'other_jurisdiction_array': 'otherJurisdictionArray', # noqa: E501 - 'other_name_array': 'otherNameArray', # noqa: E501 - 'parish': 'parish', # noqa: E501 - 'pending_proceeding_array': 'pendingProceedingArray', # noqa: E501 - 'position': 'position', # noqa: E501 - 'practice_area_array': 'practiceAreaArray', # noqa: E501 - 'practice_location_array': 'practiceLocationArray', # noqa: E501 - 'private_law_practice': 'privateLawPractice', # noqa: E501 - 'profile_last_certified': 'profileLastCertified', # noqa: E501 - 'public_hearing_array': 'publicHearingArray', # noqa: E501 - 'reason_for_inactivation': 'reasonForInactivation', # noqa: E501 - 'sections_array': 'sectionsArray', # noqa: E501 - 'services_array': 'servicesArray', # noqa: E501 - 'source_info': 'sourceInfo', # noqa: E501 - 'statewide_grievance_committee_history_array': 'statewideGrievanceCommitteeHistoryArray', # noqa: E501 - 'status': 'status', # noqa: E501 - 'status_date': 'statusDate', # noqa: E501 - 'status_history_array': 'statusHistoryArray', # noqa: E501 - 'ten_year_discipline_array': 'tenYearDisciplineArray', # noqa: E501 - 'undergraduate_school': 'undergraduateSchool', # noqa: E501 - 'bar_law_firm': 'barLawFirm', # noqa: E501 - 'years_of_practice': 'yearsOfPractice', # noqa: E501 - 'clients_represented_array': 'clientsRepresentedArray', # noqa: E501 - 'status_hint': 'statusHint', # noqa: E501 - 'advanced_degree_array': 'advancedDegreeArray', # noqa: E501 - 'bar_status_array': 'barStatusArray', # noqa: E501 - 'related_cases_array': 'relatedCasesArray', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in administrative_actions_array (list) + _items = [] + if self.administrative_actions_array: + for _item in self.administrative_actions_array: + if _item: + _items.append(_item.to_dict()) + _dict['administrativeActionsArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in board_certifications_array (list) + _items = [] + if self.board_certifications_array: + for _item in self.board_certifications_array: + if _item: + _items.append(_item.to_dict()) + _dict['boardCertificationsArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in committees_array (list) + _items = [] + if self.committees_array: + for _item in self.committees_array: + if _item: + _items.append(_item.to_dict()) + _dict['committeesArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in court_history_array (list) + _items = [] + if self.court_history_array: + for _item in self.court_history_array: + if _item: + _items.append(_item.to_dict()) + _dict['courtHistoryArray'] = _items + # override the default output from pydantic by calling `to_dict()` of court_of_admissions + if self.court_of_admissions: + _dict['courtOfAdmissions'] = self.court_of_admissions.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in disciplinary_history_array (list) + _items = [] + if self.disciplinary_history_array: + for _item in self.disciplinary_history_array: + if _item: + _items.append(_item.to_dict()) + _dict['disciplinaryHistoryArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in discipline_summaries_array (list) + _items = [] + if self.discipline_summaries_array: + for _item in self.discipline_summaries_array: + if _item: + _items.append(_item.to_dict()) + _dict['disciplineSummariesArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in employment_history_array (list) + _items = [] + if self.employment_history_array: + for _item in self.employment_history_array: + if _item: + _items.append(_item.to_dict()) + _dict['employmentHistoryArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in fees_options_array (list) + _items = [] + if self.fees_options_array: + for _item in self.fees_options_array: + if _item: + _items.append(_item.to_dict()) + _dict['feesOptionsArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in involvements_array (list) + _items = [] + if self.involvements_array: + for _item in self.involvements_array: + if _item: + _items.append(_item.to_dict()) + _dict['involvementsArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in law_school_array (list) + _items = [] + if self.law_school_array: + for _item in self.law_school_array: + if _item: + _items.append(_item.to_dict()) + _dict['lawSchoolArray'] = _items + # override the default output from pydantic by calling `to_dict()` of name + if self.name: + _dict['name'] = self.name.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in open_action_status_array (list) + _items = [] + if self.open_action_status_array: + for _item in self.open_action_status_array: + if _item: + _items.append(_item.to_dict()) + _dict['openActionStatusArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in other_jurisdiction_array (list) + _items = [] + if self.other_jurisdiction_array: + for _item in self.other_jurisdiction_array: + if _item: + _items.append(_item.to_dict()) + _dict['otherJurisdictionArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in public_hearing_array (list) + _items = [] + if self.public_hearing_array: + for _item in self.public_hearing_array: + if _item: + _items.append(_item.to_dict()) + _dict['publicHearingArray'] = _items + # override the default output from pydantic by calling `to_dict()` of reason_for_inactivation + if self.reason_for_inactivation: + _dict['reasonForInactivation'] = self.reason_for_inactivation.to_dict() + # override the default output from pydantic by calling `to_dict()` of source_info + if self.source_info: + _dict['sourceInfo'] = self.source_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in statewide_grievance_committee_history_array (list) + _items = [] + if self.statewide_grievance_committee_history_array: + for _item in self.statewide_grievance_committee_history_array: + if _item: + _items.append(_item.to_dict()) + _dict['statewideGrievanceCommitteeHistoryArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in status_history_array (list) + _items = [] + if self.status_history_array: + for _item in self.status_history_array: + if _item: + _items.append(_item.to_dict()) + _dict['statusHistoryArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ten_year_discipline_array (list) + _items = [] + if self.ten_year_discipline_array: + for _item in self.ten_year_discipline_array: + if _item: + _items.append(_item.to_dict()) + _dict['tenYearDisciplineArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in advanced_degree_array (list) + _items = [] + if self.advanced_degree_array: + for _item in self.advanced_degree_array: + if _item: + _items.append(_item.to_dict()) + _dict['advancedDegreeArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in bar_status_array (list) + _items = [] + if self.bar_status_array: + for _item in self.bar_status_array: + if _item: + _items.append(_item.to_dict()) + _dict['barStatusArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in related_cases_array (list) + _items = [] + if self.related_cases_array: + for _item in self.related_cases_array: + if _item: + _items.append(_item.to_dict()) + _dict['relatedCasesArray'] = _items + # set to None if admission_type (nullable) is None + # and model_fields_set contains the field + if self.admission_type is None and "admission_type" in self.model_fields_set: + _dict['admissionType'] = None + + # set to None if appellate_court_district (nullable) is None + # and model_fields_set contains the field + if self.appellate_court_district is None and "appellate_court_district" in self.model_fields_set: + _dict['appellateCourtDistrict'] = None + + # set to None if appellate_division_department (nullable) is None + # and model_fields_set contains the field + if self.appellate_division_department is None and "appellate_division_department" in self.model_fields_set: + _dict['appellateDivisionDepartment'] = None + + # set to None if attorney_group (nullable) is None + # and model_fields_set contains the field + if self.attorney_group is None and "attorney_group" in self.model_fields_set: + _dict['attorneyGroup'] = None + + # set to None if authorized (nullable) is None + # and model_fields_set contains the field + if self.authorized is None and "authorized" in self.model_fields_set: + _dict['authorized'] = None + + # set to None if bar_service_class (nullable) is None + # and model_fields_set contains the field + if self.bar_service_class is None and "bar_service_class" in self.model_fields_set: + _dict['barServiceClass'] = None + + # set to None if bio (nullable) is None + # and model_fields_set contains the field + if self.bio is None and "bio" in self.model_fields_set: + _dict['bio'] = None + + # set to None if board_district (nullable) is None + # and model_fields_set contains the field + if self.board_district is None and "board_district" in self.model_fields_set: + _dict['boardDistrict'] = None + + # set to None if circuit (nullable) is None + # and model_fields_set contains the field + if self.circuit is None and "circuit" in self.model_fields_set: + _dict['circuit'] = None + + # set to None if comments (nullable) is None + # and model_fields_set contains the field + if self.comments is None and "comments" in self.model_fields_set: + _dict['comments'] = None + + # set to None if court_service_email (nullable) is None + # and model_fields_set contains the field + if self.court_service_email is None and "court_service_email" in self.model_fields_set: + _dict['courtServiceEmail'] = None + + # set to None if district (nullable) is None + # and model_fields_set contains the field + if self.district is None and "district" in self.model_fields_set: + _dict['district'] = None + + # set to None if expiration_date (nullable) is None + # and model_fields_set contains the field + if self.expiration_date is None and "expiration_date" in self.model_fields_set: + _dict['expirationDate'] = None + + # set to None if firm_size (nullable) is None + # and model_fields_set contains the field + if self.firm_size is None and "firm_size" in self.model_fields_set: + _dict['firmSize'] = None + + # set to None if firm_website (nullable) is None + # and model_fields_set contains the field + if self.firm_website is None and "firm_website" in self.model_fields_set: + _dict['firmWebsite'] = None + + # set to None if first_admitted_date (nullable) is None + # and model_fields_set contains the field + if self.first_admitted_date is None and "first_admitted_date" in self.model_fields_set: + _dict['firstAdmittedDate'] = None + + # set to None if first_admitted_year (nullable) is None + # and model_fields_set contains the field + if self.first_admitted_year is None and "first_admitted_year" in self.model_fields_set: + _dict['firstAdmittedYear'] = None + + # set to None if home_county (nullable) is None + # and model_fields_set contains the field + if self.home_county is None and "home_county" in self.model_fields_set: + _dict['homeCounty'] = None + + # set to None if in_good_standing (nullable) is None + # and model_fields_set contains the field + if self.in_good_standing is None and "in_good_standing" in self.model_fields_set: + _dict['inGoodStanding'] = None + + # set to None if insurance (nullable) is None + # and model_fields_set contains the field + if self.insurance is None and "insurance" in self.model_fields_set: + _dict['insurance'] = None + + # set to None if judicial_district (nullable) is None + # and model_fields_set contains the field + if self.judicial_district is None and "judicial_district" in self.model_fields_set: + _dict['judicialDistrict'] = None + + # set to None if juris_type (nullable) is None + # and model_fields_set contains the field + if self.juris_type is None and "juris_type" in self.model_fields_set: + _dict['jurisType'] = None + + # set to None if last_renewal_date (nullable) is None + # and model_fields_set contains the field + if self.last_renewal_date is None and "last_renewal_date" in self.model_fields_set: + _dict['lastRenewalDate'] = None + + # set to None if license_type (nullable) is None + # and model_fields_set contains the field + if self.license_type is None and "license_type" in self.model_fields_set: + _dict['licenseType'] = None + + # set to None if next_registration (nullable) is None + # and model_fields_set contains the field + if self.next_registration is None and "next_registration" in self.model_fields_set: + _dict['nextRegistration'] = None + + # set to None if next_renewal_date (nullable) is None + # and model_fields_set contains the field + if self.next_renewal_date is None and "next_renewal_date" in self.model_fields_set: + _dict['nextRenewalDate'] = None + + # set to None if parish (nullable) is None + # and model_fields_set contains the field + if self.parish is None and "parish" in self.model_fields_set: + _dict['parish'] = None + + # set to None if position (nullable) is None + # and model_fields_set contains the field + if self.position is None and "position" in self.model_fields_set: + _dict['position'] = None + + # set to None if private_law_practice (nullable) is None + # and model_fields_set contains the field + if self.private_law_practice is None and "private_law_practice" in self.model_fields_set: + _dict['privateLawPractice'] = None + + # set to None if profile_last_certified (nullable) is None + # and model_fields_set contains the field + if self.profile_last_certified is None and "profile_last_certified" in self.model_fields_set: + _dict['profileLastCertified'] = None + + # set to None if status (nullable) is None + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: + _dict['status'] = None + + # set to None if status_date (nullable) is None + # and model_fields_set contains the field + if self.status_date is None and "status_date" in self.model_fields_set: + _dict['statusDate'] = None + + # set to None if undergraduate_school (nullable) is None + # and model_fields_set contains the field + if self.undergraduate_school is None and "undergraduate_school" in self.model_fields_set: + _dict['undergraduateSchool'] = None + + # set to None if bar_law_firm (nullable) is None + # and model_fields_set contains the field + if self.bar_law_firm is None and "bar_law_firm" in self.model_fields_set: + _dict['barLawFirm'] = None + + # set to None if years_of_practice (nullable) is None + # and model_fields_set contains the field + if self.years_of_practice is None and "years_of_practice" in self.model_fields_set: + _dict['yearsOfPractice'] = None + + # set to None if status_hint (nullable) is None + # and model_fields_set contains the field + if self.status_hint is None and "status_hint" in self.model_fields_set: + _dict['statusHint'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, administrative_actions_array, admission_type, appellate_court_district, appellate_division_department, attorney_group, authorized, bar_service_class, bio, board_certifications_array, board_district, circuit, comments, committees_array, court_history_array, court_of_admissions, court_service_email, disciplinary_history_array, discipline_summaries_array, dismissals_array, district, employment_history_array, expiration_date, fees_options_array, firm_size, firm_website, first_admitted_date, first_admitted_year, home_county, in_good_standing, insurance, involvements_array, judicial_district, juris_type, languages_array, last_renewal_date, law_school_array, legal_speciality_array, license_type, name, next_registration, next_renewal_date, open_action_status_array, other_jurisdiction_array, other_name_array, parish, pending_proceeding_array, position, practice_area_array, practice_location_array, private_law_practice, profile_last_certified, public_hearing_array, reason_for_inactivation, sections_array, services_array, source_info, statewide_grievance_committee_history_array, status, status_date, status_history_array, ten_year_discipline_array, undergraduate_school, bar_law_firm, years_of_practice, clients_represented_array, status_hint, advanced_degree_array, bar_status_array, related_cases_array, *args, **kwargs): # noqa: E501 - """BarSourceData - a model defined in OpenAPI - - Args: - administrative_actions_array ([BarSourceDataAdministrativeActionsArrayInner]): - admission_type (str, none_type): - appellate_court_district (str, none_type): - appellate_division_department (str, none_type): - attorney_group (str, none_type): - authorized (str, none_type): - bar_service_class (str, none_type): - bio (str, none_type): - board_certifications_array ([BarSourceDataBoardCertificationsArrayInner]): - board_district (str, none_type): - circuit (str, none_type): - comments (str, none_type): - committees_array ([BarSourceDataCommitteesArrayInner]): - court_history_array ([BarSourceDataCourtHistoryArrayInner]): - court_of_admissions (BarSourceDataCourtOfAdmissions): - court_service_email (str, none_type): - disciplinary_history_array ([BarSourceDataDisciplinaryHistoryArrayInner]): - discipline_summaries_array ([BarSourceDataDisciplineSummariesArrayInner]): - dismissals_array ([str]): - district (str, none_type): - employment_history_array ([BarSourceDataEmploymentHistoryArrayInner]): - expiration_date (datetime, none_type): - fees_options_array ([BarSourceDataFeesOptionsArrayInner]): - firm_size (str, none_type): - firm_website (str, none_type): - first_admitted_date (datetime, none_type): The firstAdmittedDate is the date when an attorney was admitted to the bar for the very first time regardless of which U.S state. - first_admitted_year (int, none_type): - home_county (str, none_type): - in_good_standing (str, none_type): - insurance (str, none_type): - involvements_array ([BarSourceDataInvolvementsArrayInner]): - judicial_district (str, none_type): - juris_type (str, none_type): - languages_array ([str]): - last_renewal_date (datetime, none_type): - law_school_array ([BarSourceDataLawSchoolArrayInner]): - legal_speciality_array ([str]): - license_type (str, none_type): - name (BarSourceDataName): - next_registration (datetime, none_type): - next_renewal_date (datetime, none_type): - open_action_status_array ([BarSourceDataOpenActionStatusArrayInner]): - other_jurisdiction_array ([BarSourceDataOtherJurisdictionArrayInner]): - other_name_array ([str]): - parish (str, none_type): - pending_proceeding_array ([str]): - position (str, none_type): - practice_area_array ([str]): - practice_location_array ([str]): - private_law_practice (str, none_type): - profile_last_certified (datetime, none_type): - public_hearing_array ([BarSourceDataPublicHearingArrayInner]): - reason_for_inactivation (BarSourceDataReasonForInactivation): - sections_array ([str]): - services_array ([str]): - source_info (BarSourceDataSourceInfo): - statewide_grievance_committee_history_array ([BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner]): - status (str, none_type): - status_date (datetime, none_type): - status_history_array ([BarSourceDataStatusHistoryArrayInner]): - ten_year_discipline_array ([BarSourceDataTenYearDisciplineArrayInner]): - undergraduate_school (str, none_type): - bar_law_firm (str, none_type): - years_of_practice (str, none_type): - clients_represented_array ([str]): - status_hint (str, none_type): - advanced_degree_array ([BarSourceDataAdvancedDegreeArrayInner]): - bar_status_array ([BarSourceDataBarStatusArrayInner]): - related_cases_array ([BarSourceDataRelatedCasesArrayInner]): - - Keyword Args: - object (str): defaults to "BarSourceData" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'BarSourceData', + "administrativeActionsArray": [BarSourceDataAdministrativeActionsArrayInner.from_dict(_item) for _item in obj["administrativeActionsArray"]] if obj.get("administrativeActionsArray") is not None else None, + "admissionType": obj.get("admissionType"), + "appellateCourtDistrict": obj.get("appellateCourtDistrict"), + "appellateDivisionDepartment": obj.get("appellateDivisionDepartment"), + "attorneyGroup": obj.get("attorneyGroup"), + "authorized": obj.get("authorized"), + "barServiceClass": obj.get("barServiceClass"), + "bio": obj.get("bio"), + "boardCertificationsArray": [BarSourceDataBoardCertificationsArrayInner.from_dict(_item) for _item in obj["boardCertificationsArray"]] if obj.get("boardCertificationsArray") is not None else None, + "boardDistrict": obj.get("boardDistrict"), + "circuit": obj.get("circuit"), + "comments": obj.get("comments"), + "committeesArray": [BarSourceDataCommitteesArrayInner.from_dict(_item) for _item in obj["committeesArray"]] if obj.get("committeesArray") is not None else None, + "courtHistoryArray": [BarSourceDataCourtHistoryArrayInner.from_dict(_item) for _item in obj["courtHistoryArray"]] if obj.get("courtHistoryArray") is not None else None, + "courtOfAdmissions": BarSourceDataCourtOfAdmissions.from_dict(obj["courtOfAdmissions"]) if obj.get("courtOfAdmissions") is not None else None, + "courtServiceEmail": obj.get("courtServiceEmail"), + "disciplinaryHistoryArray": [BarSourceDataDisciplinaryHistoryArrayInner.from_dict(_item) for _item in obj["disciplinaryHistoryArray"]] if obj.get("disciplinaryHistoryArray") is not None else None, + "disciplineSummariesArray": [BarSourceDataDisciplineSummariesArrayInner.from_dict(_item) for _item in obj["disciplineSummariesArray"]] if obj.get("disciplineSummariesArray") is not None else None, + "dismissalsArray": obj.get("dismissalsArray"), + "district": obj.get("district"), + "employmentHistoryArray": [BarSourceDataEmploymentHistoryArrayInner.from_dict(_item) for _item in obj["employmentHistoryArray"]] if obj.get("employmentHistoryArray") is not None else None, + "expirationDate": obj.get("expirationDate"), + "feesOptionsArray": [BarSourceDataFeesOptionsArrayInner.from_dict(_item) for _item in obj["feesOptionsArray"]] if obj.get("feesOptionsArray") is not None else None, + "firmSize": obj.get("firmSize"), + "firmWebsite": obj.get("firmWebsite"), + "firstAdmittedDate": obj.get("firstAdmittedDate"), + "firstAdmittedYear": obj.get("firstAdmittedYear"), + "homeCounty": obj.get("homeCounty"), + "inGoodStanding": obj.get("inGoodStanding"), + "insurance": obj.get("insurance"), + "involvementsArray": [BarSourceDataInvolvementsArrayInner.from_dict(_item) for _item in obj["involvementsArray"]] if obj.get("involvementsArray") is not None else None, + "judicialDistrict": obj.get("judicialDistrict"), + "jurisType": obj.get("jurisType"), + "languagesArray": obj.get("languagesArray"), + "lastRenewalDate": obj.get("lastRenewalDate"), + "lawSchoolArray": [BarSourceDataLawSchoolArrayInner.from_dict(_item) for _item in obj["lawSchoolArray"]] if obj.get("lawSchoolArray") is not None else None, + "legalSpecialityArray": obj.get("legalSpecialityArray"), + "licenseType": obj.get("licenseType"), + "name": BarSourceDataName.from_dict(obj["name"]) if obj.get("name") is not None else None, + "nextRegistration": obj.get("nextRegistration"), + "nextRenewalDate": obj.get("nextRenewalDate"), + "openActionStatusArray": [BarSourceDataOpenActionStatusArrayInner.from_dict(_item) for _item in obj["openActionStatusArray"]] if obj.get("openActionStatusArray") is not None else None, + "otherJurisdictionArray": [BarSourceDataOtherJurisdictionArrayInner.from_dict(_item) for _item in obj["otherJurisdictionArray"]] if obj.get("otherJurisdictionArray") is not None else None, + "otherNameArray": obj.get("otherNameArray"), + "parish": obj.get("parish"), + "pendingProceedingArray": obj.get("pendingProceedingArray"), + "position": obj.get("position"), + "practiceAreaArray": obj.get("practiceAreaArray"), + "practiceLocationArray": obj.get("practiceLocationArray"), + "privateLawPractice": obj.get("privateLawPractice"), + "profileLastCertified": obj.get("profileLastCertified"), + "publicHearingArray": [BarSourceDataPublicHearingArrayInner.from_dict(_item) for _item in obj["publicHearingArray"]] if obj.get("publicHearingArray") is not None else None, + "reasonForInactivation": BarSourceDataReasonForInactivation.from_dict(obj["reasonForInactivation"]) if obj.get("reasonForInactivation") is not None else None, + "sectionsArray": obj.get("sectionsArray"), + "servicesArray": obj.get("servicesArray"), + "sourceInfo": BarSourceDataSourceInfo.from_dict(obj["sourceInfo"]) if obj.get("sourceInfo") is not None else None, + "statewideGrievanceCommitteeHistoryArray": [BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner.from_dict(_item) for _item in obj["statewideGrievanceCommitteeHistoryArray"]] if obj.get("statewideGrievanceCommitteeHistoryArray") is not None else None, + "status": obj.get("status"), + "statusDate": obj.get("statusDate"), + "statusHistoryArray": [BarSourceDataStatusHistoryArrayInner.from_dict(_item) for _item in obj["statusHistoryArray"]] if obj.get("statusHistoryArray") is not None else None, + "tenYearDisciplineArray": [BarSourceDataTenYearDisciplineArrayInner.from_dict(_item) for _item in obj["tenYearDisciplineArray"]] if obj.get("tenYearDisciplineArray") is not None else None, + "undergraduateSchool": obj.get("undergraduateSchool"), + "barLawFirm": obj.get("barLawFirm"), + "yearsOfPractice": obj.get("yearsOfPractice"), + "clientsRepresentedArray": obj.get("clientsRepresentedArray"), + "statusHint": obj.get("statusHint"), + "advancedDegreeArray": [BarSourceDataAdvancedDegreeArrayInner.from_dict(_item) for _item in obj["advancedDegreeArray"]] if obj.get("advancedDegreeArray") is not None else None, + "barStatusArray": [BarSourceDataBarStatusArrayInner.from_dict(_item) for _item in obj["barStatusArray"]] if obj.get("barStatusArray") is not None else None, + "relatedCasesArray": [BarSourceDataRelatedCasesArrayInner.from_dict(_item) for _item in obj["relatedCasesArray"]] if obj.get("relatedCasesArray") is not None else None + }) + return _obj - object = kwargs.get('object', "BarSourceData") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.administrative_actions_array = administrative_actions_array - self.admission_type = admission_type - self.appellate_court_district = appellate_court_district - self.appellate_division_department = appellate_division_department - self.attorney_group = attorney_group - self.authorized = authorized - self.bar_service_class = bar_service_class - self.bio = bio - self.board_certifications_array = board_certifications_array - self.board_district = board_district - self.circuit = circuit - self.comments = comments - self.committees_array = committees_array - self.court_history_array = court_history_array - self.court_of_admissions = court_of_admissions - self.court_service_email = court_service_email - self.disciplinary_history_array = disciplinary_history_array - self.discipline_summaries_array = discipline_summaries_array - self.dismissals_array = dismissals_array - self.district = district - self.employment_history_array = employment_history_array - self.expiration_date = expiration_date - self.fees_options_array = fees_options_array - self.firm_size = firm_size - self.firm_website = firm_website - self.first_admitted_date = first_admitted_date - self.first_admitted_year = first_admitted_year - self.home_county = home_county - self.in_good_standing = in_good_standing - self.insurance = insurance - self.involvements_array = involvements_array - self.judicial_district = judicial_district - self.juris_type = juris_type - self.languages_array = languages_array - self.last_renewal_date = last_renewal_date - self.law_school_array = law_school_array - self.legal_speciality_array = legal_speciality_array - self.license_type = license_type - self.name = name - self.next_registration = next_registration - self.next_renewal_date = next_renewal_date - self.open_action_status_array = open_action_status_array - self.other_jurisdiction_array = other_jurisdiction_array - self.other_name_array = other_name_array - self.parish = parish - self.pending_proceeding_array = pending_proceeding_array - self.position = position - self.practice_area_array = practice_area_array - self.practice_location_array = practice_location_array - self.private_law_practice = private_law_practice - self.profile_last_certified = profile_last_certified - self.public_hearing_array = public_hearing_array - self.reason_for_inactivation = reason_for_inactivation - self.sections_array = sections_array - self.services_array = services_array - self.source_info = source_info - self.statewide_grievance_committee_history_array = statewide_grievance_committee_history_array - self.status = status - self.status_date = status_date - self.status_history_array = status_history_array - self.ten_year_discipline_array = ten_year_discipline_array - self.undergraduate_school = undergraduate_school - self.bar_law_firm = bar_law_firm - self.years_of_practice = years_of_practice - self.clients_represented_array = clients_represented_array - self.status_hint = status_hint - self.advanced_degree_array = advanced_degree_array - self.bar_status_array = bar_status_array - self.related_cases_array = related_cases_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, administrative_actions_array, admission_type, appellate_court_district, appellate_division_department, attorney_group, authorized, bar_service_class, bio, board_certifications_array, board_district, circuit, comments, committees_array, court_history_array, court_of_admissions, court_service_email, disciplinary_history_array, discipline_summaries_array, dismissals_array, district, employment_history_array, expiration_date, fees_options_array, firm_size, firm_website, first_admitted_date, first_admitted_year, home_county, in_good_standing, insurance, involvements_array, judicial_district, juris_type, languages_array, last_renewal_date, law_school_array, legal_speciality_array, license_type, name, next_registration, next_renewal_date, open_action_status_array, other_jurisdiction_array, other_name_array, parish, pending_proceeding_array, position, practice_area_array, practice_location_array, private_law_practice, profile_last_certified, public_hearing_array, reason_for_inactivation, sections_array, services_array, source_info, statewide_grievance_committee_history_array, status, status_date, status_history_array, ten_year_discipline_array, undergraduate_school, bar_law_firm, years_of_practice, clients_represented_array, status_hint, advanced_degree_array, bar_status_array, related_cases_array, *args, **kwargs): # noqa: E501 - """BarSourceData - a model defined in OpenAPI - - Args: - administrative_actions_array ([BarSourceDataAdministrativeActionsArrayInner]): - admission_type (str, none_type): - appellate_court_district (str, none_type): - appellate_division_department (str, none_type): - attorney_group (str, none_type): - authorized (str, none_type): - bar_service_class (str, none_type): - bio (str, none_type): - board_certifications_array ([BarSourceDataBoardCertificationsArrayInner]): - board_district (str, none_type): - circuit (str, none_type): - comments (str, none_type): - committees_array ([BarSourceDataCommitteesArrayInner]): - court_history_array ([BarSourceDataCourtHistoryArrayInner]): - court_of_admissions (BarSourceDataCourtOfAdmissions): - court_service_email (str, none_type): - disciplinary_history_array ([BarSourceDataDisciplinaryHistoryArrayInner]): - discipline_summaries_array ([BarSourceDataDisciplineSummariesArrayInner]): - dismissals_array ([str]): - district (str, none_type): - employment_history_array ([BarSourceDataEmploymentHistoryArrayInner]): - expiration_date (datetime, none_type): - fees_options_array ([BarSourceDataFeesOptionsArrayInner]): - firm_size (str, none_type): - firm_website (str, none_type): - first_admitted_date (datetime, none_type): The firstAdmittedDate is the date when an attorney was admitted to the bar for the very first time regardless of which U.S state. - first_admitted_year (int, none_type): - home_county (str, none_type): - in_good_standing (str, none_type): - insurance (str, none_type): - involvements_array ([BarSourceDataInvolvementsArrayInner]): - judicial_district (str, none_type): - juris_type (str, none_type): - languages_array ([str]): - last_renewal_date (datetime, none_type): - law_school_array ([BarSourceDataLawSchoolArrayInner]): - legal_speciality_array ([str]): - license_type (str, none_type): - name (BarSourceDataName): - next_registration (datetime, none_type): - next_renewal_date (datetime, none_type): - open_action_status_array ([BarSourceDataOpenActionStatusArrayInner]): - other_jurisdiction_array ([BarSourceDataOtherJurisdictionArrayInner]): - other_name_array ([str]): - parish (str, none_type): - pending_proceeding_array ([str]): - position (str, none_type): - practice_area_array ([str]): - practice_location_array ([str]): - private_law_practice (str, none_type): - profile_last_certified (datetime, none_type): - public_hearing_array ([BarSourceDataPublicHearingArrayInner]): - reason_for_inactivation (BarSourceDataReasonForInactivation): - sections_array ([str]): - services_array ([str]): - source_info (BarSourceDataSourceInfo): - statewide_grievance_committee_history_array ([BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner]): - status (str, none_type): - status_date (datetime, none_type): - status_history_array ([BarSourceDataStatusHistoryArrayInner]): - ten_year_discipline_array ([BarSourceDataTenYearDisciplineArrayInner]): - undergraduate_school (str, none_type): - bar_law_firm (str, none_type): - years_of_practice (str, none_type): - clients_represented_array ([str]): - status_hint (str, none_type): - advanced_degree_array ([BarSourceDataAdvancedDegreeArrayInner]): - bar_status_array ([BarSourceDataBarStatusArrayInner]): - related_cases_array ([BarSourceDataRelatedCasesArrayInner]): - - Keyword Args: - object (str): defaults to "BarSourceData" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - object = kwargs.get('object', "BarSourceData") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.administrative_actions_array = administrative_actions_array - self.admission_type = admission_type - self.appellate_court_district = appellate_court_district - self.appellate_division_department = appellate_division_department - self.attorney_group = attorney_group - self.authorized = authorized - self.bar_service_class = bar_service_class - self.bio = bio - self.board_certifications_array = board_certifications_array - self.board_district = board_district - self.circuit = circuit - self.comments = comments - self.committees_array = committees_array - self.court_history_array = court_history_array - self.court_of_admissions = court_of_admissions - self.court_service_email = court_service_email - self.disciplinary_history_array = disciplinary_history_array - self.discipline_summaries_array = discipline_summaries_array - self.dismissals_array = dismissals_array - self.district = district - self.employment_history_array = employment_history_array - self.expiration_date = expiration_date - self.fees_options_array = fees_options_array - self.firm_size = firm_size - self.firm_website = firm_website - self.first_admitted_date = first_admitted_date - self.first_admitted_year = first_admitted_year - self.home_county = home_county - self.in_good_standing = in_good_standing - self.insurance = insurance - self.involvements_array = involvements_array - self.judicial_district = judicial_district - self.juris_type = juris_type - self.languages_array = languages_array - self.last_renewal_date = last_renewal_date - self.law_school_array = law_school_array - self.legal_speciality_array = legal_speciality_array - self.license_type = license_type - self.name = name - self.next_registration = next_registration - self.next_renewal_date = next_renewal_date - self.open_action_status_array = open_action_status_array - self.other_jurisdiction_array = other_jurisdiction_array - self.other_name_array = other_name_array - self.parish = parish - self.pending_proceeding_array = pending_proceeding_array - self.position = position - self.practice_area_array = practice_area_array - self.practice_location_array = practice_location_array - self.private_law_practice = private_law_practice - self.profile_last_certified = profile_last_certified - self.public_hearing_array = public_hearing_array - self.reason_for_inactivation = reason_for_inactivation - self.sections_array = sections_array - self.services_array = services_array - self.source_info = source_info - self.statewide_grievance_committee_history_array = statewide_grievance_committee_history_array - self.status = status - self.status_date = status_date - self.status_history_array = status_history_array - self.ten_year_discipline_array = ten_year_discipline_array - self.undergraduate_school = undergraduate_school - self.bar_law_firm = bar_law_firm - self.years_of_practice = years_of_practice - self.clients_represented_array = clients_represented_array - self.status_hint = status_hint - self.advanced_degree_array = advanced_degree_array - self.bar_status_array = bar_status_array - self.related_cases_array = related_cases_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_administrative_actions_array_inner.py b/unicourt/model/bar_source_data_administrative_actions_array_inner.py index 446c41c..9160573 100644 --- a/unicourt/model/bar_source_data_administrative_actions_array_inner.py +++ b/unicourt/model/bar_source_data_administrative_actions_array_inner.py @@ -1,308 +1,122 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class BarSourceDataAdministrativeActionsArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class BarSourceDataAdministrativeActionsArrayInner(BaseModel): """ + BarSourceDataAdministrativeActionsArrayInner + """ # noqa: E501 + case_number: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="caseNumber") + description: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + effective_date: Optional[datetime] = Field(default=None, alias="effectiveDate") + resulting_status: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="resultingStatus") + type: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["caseNumber", "description", "effectiveDate", "resultingStatus", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('case_number',): { - 'max_length': 250, - }, - ('description',): { - 'max_length': 250, - }, - ('effective_date',): { - 'max_length': 25, - }, - ('resulting_status',): { - 'max_length': 250, - }, - ('type',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataAdministrativeActionsArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'case_number': (str, none_type,), # noqa: E501 - 'description': (str, none_type,), # noqa: E501 - 'effective_date': (datetime, none_type,), # noqa: E501 - 'resulting_status': (str, none_type,), # noqa: E501 - 'type': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'case_number': 'caseNumber', # noqa: E501 - 'description': 'description', # noqa: E501 - 'effective_date': 'effectiveDate', # noqa: E501 - 'resulting_status': 'resultingStatus', # noqa: E501 - 'type': 'type', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if case_number (nullable) is None + # and model_fields_set contains the field + if self.case_number is None and "case_number" in self.model_fields_set: + _dict['caseNumber'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if effective_date (nullable) is None + # and model_fields_set contains the field + if self.effective_date is None and "effective_date" in self.model_fields_set: + _dict['effectiveDate'] = None + + # set to None if resulting_status (nullable) is None + # and model_fields_set contains the field + if self.resulting_status is None and "resulting_status" in self.model_fields_set: + _dict['resultingStatus'] = None + + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_number, description, effective_date, resulting_status, type, *args, **kwargs): # noqa: E501 - """BarSourceDataAdministrativeActionsArrayInner - a model defined in OpenAPI - - Args: - case_number (str, none_type): - description (str, none_type): - effective_date (datetime, none_type): - resulting_status (str, none_type): - type (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.case_number = case_number - self.description = description - self.effective_date = effective_date - self.resulting_status = resulting_status - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_number, description, effective_date, resulting_status, type, *args, **kwargs): # noqa: E501 - """BarSourceDataAdministrativeActionsArrayInner - a model defined in OpenAPI - - Args: - case_number (str, none_type): - description (str, none_type): - effective_date (datetime, none_type): - resulting_status (str, none_type): - type (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataAdministrativeActionsArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "caseNumber": obj.get("caseNumber"), + "description": obj.get("description"), + "effectiveDate": obj.get("effectiveDate"), + "resultingStatus": obj.get("resultingStatus"), + "type": obj.get("type") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.case_number = case_number - self.description = description - self.effective_date = effective_date - self.resulting_status = resulting_status - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_advanced_degree_array_inner.py b/unicourt/model/bar_source_data_advanced_degree_array_inner.py index 1690787..7724582 100644 --- a/unicourt/model/bar_source_data_advanced_degree_array_inner.py +++ b/unicourt/model/bar_source_data_advanced_degree_array_inner.py @@ -1,281 +1,100 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataAdvancedDegreeArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('area',): { - 'max_length': 250, - }, - ('degree',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'area': (str, none_type,), # noqa: E501 - 'degree': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataAdvancedDegreeArrayInner(BaseModel): + """ + BarSourceDataAdvancedDegreeArrayInner + """ # noqa: E501 + area: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + degree: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["area", "degree"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'area': 'area', # noqa: E501 - 'degree': 'degree', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, area, degree, *args, **kwargs): # noqa: E501 - """BarSourceDataAdvancedDegreeArrayInner - a model defined in OpenAPI - - Args: - area (str, none_type): - degree (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataAdvancedDegreeArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.area = area - self.degree = degree - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, area, degree, *args, **kwargs): # noqa: E501 - """BarSourceDataAdvancedDegreeArrayInner - a model defined in OpenAPI - - Args: - area (str, none_type): - degree (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if area (nullable) is None + # and model_fields_set contains the field + if self.area is None and "area" in self.model_fields_set: + _dict['area'] = None + + # set to None if degree (nullable) is None + # and model_fields_set contains the field + if self.degree is None and "degree" in self.model_fields_set: + _dict['degree'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataAdvancedDegreeArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "area": obj.get("area"), + "degree": obj.get("degree") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.area = area - self.degree = degree - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_bar_status_array_inner.py b/unicourt/model/bar_source_data_bar_status_array_inner.py index f025f54..405a589 100644 --- a/unicourt/model/bar_source_data_bar_status_array_inner.py +++ b/unicourt/model/bar_source_data_bar_status_array_inner.py @@ -1,281 +1,100 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataBarStatusArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('status',): { - 'max_length': 250, - }, - ('date',): { - 'max_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'status': (str, none_type,), # noqa: E501 - 'date': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataBarStatusArrayInner(BaseModel): + """ + BarSourceDataBarStatusArrayInner + """ # noqa: E501 + status: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + date: Optional[Annotated[str, Field(strict=True, max_length=25)]] = Field(default=None, alias="date") + __properties: ClassVar[List[str]] = ["status", "date"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'status': 'status', # noqa: E501 - 'date': 'date', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, status, date, *args, **kwargs): # noqa: E501 - """BarSourceDataBarStatusArrayInner - a model defined in OpenAPI - - Args: - status (str, none_type): - date (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataBarStatusArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.status = status - self.date = date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, status, date, *args, **kwargs): # noqa: E501 - """BarSourceDataBarStatusArrayInner - a model defined in OpenAPI - - Args: - status (str, none_type): - date (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if status (nullable) is None + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: + _dict['status'] = None + + # set to None if date (nullable) is None + # and model_fields_set contains the field + if self.date is None and "date" in self.model_fields_set: + _dict['date'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataBarStatusArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "status": obj.get("status"), + "date": obj.get("date") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.status = status - self.date = date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_board_certifications_array_inner.py b/unicourt/model/bar_source_data_board_certifications_array_inner.py index 8c69177..ccdce86 100644 --- a/unicourt/model/bar_source_data_board_certifications_array_inner.py +++ b/unicourt/model/bar_source_data_board_certifications_array_inner.py @@ -1,281 +1,100 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataBoardCertificationsArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('area',): { - 'max_length': 250, - }, - ('year',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'area': (str, none_type,), # noqa: E501 - 'year': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataBoardCertificationsArrayInner(BaseModel): + """ + BarSourceDataBoardCertificationsArrayInner + """ # noqa: E501 + area: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + year: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["area", "year"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'area': 'area', # noqa: E501 - 'year': 'year', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, area, year, *args, **kwargs): # noqa: E501 - """BarSourceDataBoardCertificationsArrayInner - a model defined in OpenAPI - - Args: - area (str, none_type): - year (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataBoardCertificationsArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.area = area - self.year = year - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, area, year, *args, **kwargs): # noqa: E501 - """BarSourceDataBoardCertificationsArrayInner - a model defined in OpenAPI - - Args: - area (str, none_type): - year (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if area (nullable) is None + # and model_fields_set contains the field + if self.area is None and "area" in self.model_fields_set: + _dict['area'] = None + + # set to None if year (nullable) is None + # and model_fields_set contains the field + if self.year is None and "year" in self.model_fields_set: + _dict['year'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataBoardCertificationsArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "area": obj.get("area"), + "year": obj.get("year") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.area = area - self.year = year - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_committees_array_inner.py b/unicourt/model/bar_source_data_committees_array_inner.py index 2e47a98..391214c 100644 --- a/unicourt/model/bar_source_data_committees_array_inner.py +++ b/unicourt/model/bar_source_data_committees_array_inner.py @@ -1,290 +1,107 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataCommitteesArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('committee',): { - 'max_length': 250, - }, - ('office',): { - 'max_length': 250, - }, - ('term',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'committee': (str, none_type,), # noqa: E501 - 'office': (str, none_type,), # noqa: E501 - 'term': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataCommitteesArrayInner(BaseModel): + """ + BarSourceDataCommitteesArrayInner + """ # noqa: E501 + committee: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + office: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + term: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["committee", "office", "term"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'committee': 'committee', # noqa: E501 - 'office': 'office', # noqa: E501 - 'term': 'term', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, committee, office, term, *args, **kwargs): # noqa: E501 - """BarSourceDataCommitteesArrayInner - a model defined in OpenAPI - - Args: - committee (str, none_type): - office (str, none_type): - term (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataCommitteesArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.committee = committee - self.office = office - self.term = term - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, committee, office, term, *args, **kwargs): # noqa: E501 - """BarSourceDataCommitteesArrayInner - a model defined in OpenAPI - - Args: - committee (str, none_type): - office (str, none_type): - term (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if committee (nullable) is None + # and model_fields_set contains the field + if self.committee is None and "committee" in self.model_fields_set: + _dict['committee'] = None + + # set to None if office (nullable) is None + # and model_fields_set contains the field + if self.office is None and "office" in self.model_fields_set: + _dict['office'] = None + + # set to None if term (nullable) is None + # and model_fields_set contains the field + if self.term is None and "term" in self.model_fields_set: + _dict['term'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataCommitteesArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "committee": obj.get("committee"), + "office": obj.get("office"), + "term": obj.get("term") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.committee = committee - self.office = office - self.term = term - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_court_history_array_inner.py b/unicourt/model/bar_source_data_court_history_array_inner.py index 94dee9a..780620d 100644 --- a/unicourt/model/bar_source_data_court_history_array_inner.py +++ b/unicourt/model/bar_source_data_court_history_array_inner.py @@ -1,299 +1,115 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class BarSourceDataCourtHistoryArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class BarSourceDataCourtHistoryArrayInner(BaseModel): """ + BarSourceDataCourtHistoryArrayInner + """ # noqa: E501 + action: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + action_comments: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = Field(default=None, alias="actionComments") + reinstated_date: Optional[datetime] = Field(default=None, alias="reinstatedDate") + start_date: Optional[datetime] = Field(default=None, alias="startDate") + __properties: ClassVar[List[str]] = ["action", "actionComments", "reinstatedDate", "startDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('action',): { - 'max_length': 250, - }, - ('action_comments',): { - 'max_length': 2000, - }, - ('reinstated_date',): { - 'max_length': 25, - }, - ('start_date',): { - 'max_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataCourtHistoryArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'action': (str, none_type,), # noqa: E501 - 'action_comments': (str, none_type,), # noqa: E501 - 'reinstated_date': (datetime, none_type,), # noqa: E501 - 'start_date': (datetime, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'action': 'action', # noqa: E501 - 'action_comments': 'actionComments', # noqa: E501 - 'reinstated_date': 'reinstatedDate', # noqa: E501 - 'start_date': 'startDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if action (nullable) is None + # and model_fields_set contains the field + if self.action is None and "action" in self.model_fields_set: + _dict['action'] = None + + # set to None if action_comments (nullable) is None + # and model_fields_set contains the field + if self.action_comments is None and "action_comments" in self.model_fields_set: + _dict['actionComments'] = None + + # set to None if reinstated_date (nullable) is None + # and model_fields_set contains the field + if self.reinstated_date is None and "reinstated_date" in self.model_fields_set: + _dict['reinstatedDate'] = None + + # set to None if start_date (nullable) is None + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: + _dict['startDate'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, action, action_comments, reinstated_date, start_date, *args, **kwargs): # noqa: E501 - """BarSourceDataCourtHistoryArrayInner - a model defined in OpenAPI - - Args: - action (str, none_type): - action_comments (str, none_type): - reinstated_date (datetime, none_type): - start_date (datetime, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.action = action - self.action_comments = action_comments - self.reinstated_date = reinstated_date - self.start_date = start_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, action, action_comments, reinstated_date, start_date, *args, **kwargs): # noqa: E501 - """BarSourceDataCourtHistoryArrayInner - a model defined in OpenAPI - - Args: - action (str, none_type): - action_comments (str, none_type): - reinstated_date (datetime, none_type): - start_date (datetime, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataCourtHistoryArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "action": obj.get("action"), + "actionComments": obj.get("actionComments"), + "reinstatedDate": obj.get("reinstatedDate"), + "startDate": obj.get("startDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.action = action - self.action_comments = action_comments - self.reinstated_date = reinstated_date - self.start_date = start_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_court_of_admissions.py b/unicourt/model/bar_source_data_court_of_admissions.py index b3ad6b6..2831603 100644 --- a/unicourt/model/bar_source_data_court_of_admissions.py +++ b/unicourt/model/bar_source_data_court_of_admissions.py @@ -1,281 +1,92 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataCourtOfAdmissions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'court_state_array': ([str],), # noqa: E501 - 'federal_array': ([str],), # noqa: E501 - 'other_courts_array': ([str],), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataCourtOfAdmissions(BaseModel): + """ + BarSourceDataCourtOfAdmissions + """ # noqa: E501 + court_state_array: Optional[List[Annotated[str, Field(strict=True, max_length=250)]]] = Field(default=None, alias="courtStateArray") + federal_array: Optional[List[Annotated[str, Field(strict=True, max_length=250)]]] = Field(default=None, alias="federalArray") + other_courts_array: Optional[List[Annotated[str, Field(strict=True, max_length=500)]]] = Field(default=None, alias="otherCourtsArray") + __properties: ClassVar[List[str]] = ["courtStateArray", "federalArray", "otherCourtsArray"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'court_state_array': 'courtStateArray', # noqa: E501 - 'federal_array': 'federalArray', # noqa: E501 - 'other_courts_array': 'otherCourtsArray', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, court_state_array, federal_array, other_courts_array, *args, **kwargs): # noqa: E501 - """BarSourceDataCourtOfAdmissions - a model defined in OpenAPI - - Args: - court_state_array ([str]): - federal_array ([str]): - other_courts_array ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataCourtOfAdmissions from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.court_state_array = court_state_array - self.federal_array = federal_array - self.other_courts_array = other_courts_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, court_state_array, federal_array, other_courts_array, *args, **kwargs): # noqa: E501 - """BarSourceDataCourtOfAdmissions - a model defined in OpenAPI + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - Args: - court_state_array ([str]): - federal_array ([str]): - other_courts_array ([str]): + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataCourtOfAdmissions from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "courtStateArray": obj.get("courtStateArray"), + "federalArray": obj.get("federalArray"), + "otherCourtsArray": obj.get("otherCourtsArray") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.court_state_array = court_state_array - self.federal_array = federal_array - self.other_courts_array = other_courts_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_disciplinary_history_array_inner.py b/unicourt/model/bar_source_data_disciplinary_history_array_inner.py index 2f040f2..6ce8e4b 100644 --- a/unicourt/model/bar_source_data_disciplinary_history_array_inner.py +++ b/unicourt/model/bar_source_data_disciplinary_history_array_inner.py @@ -1,453 +1,234 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations +import pprint import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataDisciplinaryHistoryArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class BarSourceDataDisciplinaryHistoryArrayInner(BaseModel): """ + BarSourceDataDisciplinaryHistoryArrayInner + """ # noqa: E501 + action: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + case_number: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="caseNumber") + complaint: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = None + contact_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=250)]] = Field(default=None, alias="contactId") + date_of_action: Optional[datetime] = Field(default=None, alias="dateOfAction") + definition: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = None + disciplinary_decision: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="disciplinaryDecision") + entry_date: Optional[datetime] = Field(default=None, alias="entryDate") + information: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + link: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + note: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = None + probation_date: Optional[datetime] = Field(default=None, alias="probationDate") + reinstated_date: Optional[datetime] = Field(default=None, alias="reinstatedDate") + rule: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + rule_number: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="ruleNumber") + section_date: Optional[datetime] = Field(default=None, alias="sectionDate") + status: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + stay_date: Optional[datetime] = Field(default=None, alias="stayDate") + supreme_court: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="supremeCourt") + term: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + type_of_action: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="typeOfAction") + __properties: ClassVar[List[str]] = ["action", "caseNumber", "complaint", "contactId", "dateOfAction", "definition", "disciplinaryDecision", "entryDate", "information", "link", "note", "probationDate", "reinstatedDate", "rule", "ruleNumber", "sectionDate", "status", "stayDate", "supremeCourt", "term", "typeOfAction"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('action',): { - 'max_length': 250, - }, - ('case_number',): { - 'max_length': 250, - }, - ('complaint',): { - 'max_length': 1000, - }, - ('contact_id',): { - 'max_length': 250, - 'min_length': 1, - }, - ('date_of_action',): { - 'max_length': 25, - }, - ('definition',): { - 'max_length': 1000, - }, - ('disciplinary_decision',): { - 'max_length': 250, - }, - ('entry_date',): { - 'max_length': 25, - }, - ('information',): { - 'max_length': 250, - }, - ('link',): { - 'max_length': 250, - }, - ('note',): { - 'max_length': 1000, - }, - ('probation_date',): { - 'max_length': 25, - }, - ('reinstated_date',): { - 'max_length': 25, - }, - ('rule',): { - 'max_length': 250, - }, - ('rule_number',): { - 'max_length': 250, - }, - ('section_date',): { - 'max_length': 25, - }, - ('status',): { - 'max_length': 250, - }, - ('stay_date',): { - 'max_length': 25, - }, - ('supreme_court',): { - 'max_length': 250, - }, - ('term',): { - 'max_length': 250, - }, - ('type_of_action',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataDisciplinaryHistoryArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'action': (str, none_type,), # noqa: E501 - 'case_number': (str, none_type,), # noqa: E501 - 'complaint': (str, none_type,), # noqa: E501 - 'contact_id': (str, none_type,), # noqa: E501 - 'date_of_action': (datetime, none_type,), # noqa: E501 - 'definition': (str, none_type,), # noqa: E501 - 'disciplinary_decision': (str, none_type,), # noqa: E501 - 'entry_date': (datetime, none_type,), # noqa: E501 - 'information': (str, none_type,), # noqa: E501 - 'link': (str, none_type,), # noqa: E501 - 'note': (str, none_type,), # noqa: E501 - 'probation_date': (datetime, none_type,), # noqa: E501 - 'reinstated_date': (datetime, none_type,), # noqa: E501 - 'rule': (str, none_type,), # noqa: E501 - 'rule_number': (str, none_type,), # noqa: E501 - 'section_date': (datetime, none_type,), # noqa: E501 - 'status': (str, none_type,), # noqa: E501 - 'stay_date': (datetime, none_type,), # noqa: E501 - 'supreme_court': (str, none_type,), # noqa: E501 - 'term': (str, none_type,), # noqa: E501 - 'type_of_action': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'action': 'action', # noqa: E501 - 'case_number': 'caseNumber', # noqa: E501 - 'complaint': 'complaint', # noqa: E501 - 'contact_id': 'contactId', # noqa: E501 - 'date_of_action': 'dateOfAction', # noqa: E501 - 'definition': 'definition', # noqa: E501 - 'disciplinary_decision': 'disciplinaryDecision', # noqa: E501 - 'entry_date': 'entryDate', # noqa: E501 - 'information': 'information', # noqa: E501 - 'link': 'link', # noqa: E501 - 'note': 'note', # noqa: E501 - 'probation_date': 'probationDate', # noqa: E501 - 'reinstated_date': 'reinstatedDate', # noqa: E501 - 'rule': 'rule', # noqa: E501 - 'rule_number': 'ruleNumber', # noqa: E501 - 'section_date': 'sectionDate', # noqa: E501 - 'status': 'status', # noqa: E501 - 'stay_date': 'stayDate', # noqa: E501 - 'supreme_court': 'supremeCourt', # noqa: E501 - 'term': 'term', # noqa: E501 - 'type_of_action': 'typeOfAction', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if action (nullable) is None + # and model_fields_set contains the field + if self.action is None and "action" in self.model_fields_set: + _dict['action'] = None + + # set to None if case_number (nullable) is None + # and model_fields_set contains the field + if self.case_number is None and "case_number" in self.model_fields_set: + _dict['caseNumber'] = None + + # set to None if complaint (nullable) is None + # and model_fields_set contains the field + if self.complaint is None and "complaint" in self.model_fields_set: + _dict['complaint'] = None + + # set to None if contact_id (nullable) is None + # and model_fields_set contains the field + if self.contact_id is None and "contact_id" in self.model_fields_set: + _dict['contactId'] = None + + # set to None if date_of_action (nullable) is None + # and model_fields_set contains the field + if self.date_of_action is None and "date_of_action" in self.model_fields_set: + _dict['dateOfAction'] = None + + # set to None if definition (nullable) is None + # and model_fields_set contains the field + if self.definition is None and "definition" in self.model_fields_set: + _dict['definition'] = None + + # set to None if disciplinary_decision (nullable) is None + # and model_fields_set contains the field + if self.disciplinary_decision is None and "disciplinary_decision" in self.model_fields_set: + _dict['disciplinaryDecision'] = None + + # set to None if entry_date (nullable) is None + # and model_fields_set contains the field + if self.entry_date is None and "entry_date" in self.model_fields_set: + _dict['entryDate'] = None + + # set to None if information (nullable) is None + # and model_fields_set contains the field + if self.information is None and "information" in self.model_fields_set: + _dict['information'] = None + + # set to None if link (nullable) is None + # and model_fields_set contains the field + if self.link is None and "link" in self.model_fields_set: + _dict['link'] = None + + # set to None if note (nullable) is None + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: + _dict['note'] = None + + # set to None if probation_date (nullable) is None + # and model_fields_set contains the field + if self.probation_date is None and "probation_date" in self.model_fields_set: + _dict['probationDate'] = None + + # set to None if reinstated_date (nullable) is None + # and model_fields_set contains the field + if self.reinstated_date is None and "reinstated_date" in self.model_fields_set: + _dict['reinstatedDate'] = None + + # set to None if rule (nullable) is None + # and model_fields_set contains the field + if self.rule is None and "rule" in self.model_fields_set: + _dict['rule'] = None + + # set to None if rule_number (nullable) is None + # and model_fields_set contains the field + if self.rule_number is None and "rule_number" in self.model_fields_set: + _dict['ruleNumber'] = None + + # set to None if section_date (nullable) is None + # and model_fields_set contains the field + if self.section_date is None and "section_date" in self.model_fields_set: + _dict['sectionDate'] = None + + # set to None if status (nullable) is None + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: + _dict['status'] = None + + # set to None if stay_date (nullable) is None + # and model_fields_set contains the field + if self.stay_date is None and "stay_date" in self.model_fields_set: + _dict['stayDate'] = None + + # set to None if supreme_court (nullable) is None + # and model_fields_set contains the field + if self.supreme_court is None and "supreme_court" in self.model_fields_set: + _dict['supremeCourt'] = None + + # set to None if term (nullable) is None + # and model_fields_set contains the field + if self.term is None and "term" in self.model_fields_set: + _dict['term'] = None + + # set to None if type_of_action (nullable) is None + # and model_fields_set contains the field + if self.type_of_action is None and "type_of_action" in self.model_fields_set: + _dict['typeOfAction'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, action, case_number, complaint, contact_id, date_of_action, definition, disciplinary_decision, entry_date, information, link, note, probation_date, reinstated_date, rule, rule_number, section_date, status, stay_date, supreme_court, term, type_of_action, *args, **kwargs): # noqa: E501 - """BarSourceDataDisciplinaryHistoryArrayInner - a model defined in OpenAPI - - Args: - action (str, none_type): - case_number (str, none_type): - complaint (str, none_type): - contact_id (str, none_type): - date_of_action (datetime, none_type): - definition (str, none_type): - disciplinary_decision (str, none_type): - entry_date (datetime, none_type): - information (str, none_type): - link (str, none_type): - note (str, none_type): - probation_date (datetime, none_type): - reinstated_date (datetime, none_type): - rule (str, none_type): - rule_number (str, none_type): - section_date (datetime, none_type): - status (str, none_type): - stay_date (datetime, none_type): - supreme_court (str, none_type): - term (str, none_type): - type_of_action (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataDisciplinaryHistoryArrayInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "action": obj.get("action"), + "caseNumber": obj.get("caseNumber"), + "complaint": obj.get("complaint"), + "contactId": obj.get("contactId"), + "dateOfAction": obj.get("dateOfAction"), + "definition": obj.get("definition"), + "disciplinaryDecision": obj.get("disciplinaryDecision"), + "entryDate": obj.get("entryDate"), + "information": obj.get("information"), + "link": obj.get("link"), + "note": obj.get("note"), + "probationDate": obj.get("probationDate"), + "reinstatedDate": obj.get("reinstatedDate"), + "rule": obj.get("rule"), + "ruleNumber": obj.get("ruleNumber"), + "sectionDate": obj.get("sectionDate"), + "status": obj.get("status"), + "stayDate": obj.get("stayDate"), + "supremeCourt": obj.get("supremeCourt"), + "term": obj.get("term"), + "typeOfAction": obj.get("typeOfAction") + }) + return _obj - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.action = action - self.case_number = case_number - self.complaint = complaint - self.contact_id = contact_id - self.date_of_action = date_of_action - self.definition = definition - self.disciplinary_decision = disciplinary_decision - self.entry_date = entry_date - self.information = information - self.link = link - self.note = note - self.probation_date = probation_date - self.reinstated_date = reinstated_date - self.rule = rule - self.rule_number = rule_number - self.section_date = section_date - self.status = status - self.stay_date = stay_date - self.supreme_court = supreme_court - self.term = term - self.type_of_action = type_of_action - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, action, case_number, complaint, contact_id, date_of_action, definition, disciplinary_decision, entry_date, information, link, note, probation_date, reinstated_date, rule, rule_number, section_date, status, stay_date, supreme_court, term, type_of_action, *args, **kwargs): # noqa: E501 - """BarSourceDataDisciplinaryHistoryArrayInner - a model defined in OpenAPI - - Args: - action (str, none_type): - case_number (str, none_type): - complaint (str, none_type): - contact_id (str, none_type): - date_of_action (datetime, none_type): - definition (str, none_type): - disciplinary_decision (str, none_type): - entry_date (datetime, none_type): - information (str, none_type): - link (str, none_type): - note (str, none_type): - probation_date (datetime, none_type): - reinstated_date (datetime, none_type): - rule (str, none_type): - rule_number (str, none_type): - section_date (datetime, none_type): - status (str, none_type): - stay_date (datetime, none_type): - supreme_court (str, none_type): - term (str, none_type): - type_of_action (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.action = action - self.case_number = case_number - self.complaint = complaint - self.contact_id = contact_id - self.date_of_action = date_of_action - self.definition = definition - self.disciplinary_decision = disciplinary_decision - self.entry_date = entry_date - self.information = information - self.link = link - self.note = note - self.probation_date = probation_date - self.reinstated_date = reinstated_date - self.rule = rule - self.rule_number = rule_number - self.section_date = section_date - self.status = status - self.stay_date = stay_date - self.supreme_court = supreme_court - self.term = term - self.type_of_action = type_of_action - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_discipline_summaries_array_inner.py b/unicourt/model/bar_source_data_discipline_summaries_array_inner.py index b3fbd93..2aed0ab 100644 --- a/unicourt/model/bar_source_data_discipline_summaries_array_inner.py +++ b/unicourt/model/bar_source_data_discipline_summaries_array_inner.py @@ -1,290 +1,108 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataDisciplineSummariesArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('date',): { - 'max_length': 25, - }, - ('link',): { - 'max_length': 250, - }, - ('title',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'date': (datetime, none_type,), # noqa: E501 - 'link': (str, none_type,), # noqa: E501 - 'title': (str, none_type,), # noqa: E501 - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataDisciplineSummariesArrayInner(BaseModel): + """ + BarSourceDataDisciplineSummariesArrayInner + """ # noqa: E501 + date: Optional[datetime] = Field(default=None, alias="date") + link: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + title: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["date", "link", "title"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'date': 'date', # noqa: E501 - 'link': 'link', # noqa: E501 - 'title': 'title', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, date, link, title, *args, **kwargs): # noqa: E501 - """BarSourceDataDisciplineSummariesArrayInner - a model defined in OpenAPI - - Args: - date (datetime, none_type): - link (str, none_type): - title (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataDisciplineSummariesArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.date = date - self.link = link - self.title = title - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, date, link, title, *args, **kwargs): # noqa: E501 - """BarSourceDataDisciplineSummariesArrayInner - a model defined in OpenAPI - - Args: - date (datetime, none_type): - link (str, none_type): - title (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if date (nullable) is None + # and model_fields_set contains the field + if self.date is None and "date" in self.model_fields_set: + _dict['date'] = None + + # set to None if link (nullable) is None + # and model_fields_set contains the field + if self.link is None and "link" in self.model_fields_set: + _dict['link'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataDisciplineSummariesArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "date": obj.get("date"), + "link": obj.get("link"), + "title": obj.get("title") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.date = date - self.link = link - self.title = title - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_employment_history_array_inner.py b/unicourt/model/bar_source_data_employment_history_array_inner.py index 302f031..5909a5b 100644 --- a/unicourt/model/bar_source_data_employment_history_array_inner.py +++ b/unicourt/model/bar_source_data_employment_history_array_inner.py @@ -1,290 +1,108 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataEmploymentHistoryArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('employer',): { - 'max_length': 250, - }, - ('end_date',): { - 'max_length': 25, - }, - ('start_date',): { - 'max_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'employer': (str, none_type,), # noqa: E501 - 'end_date': (datetime, none_type,), # noqa: E501 - 'start_date': (datetime, none_type,), # noqa: E501 - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataEmploymentHistoryArrayInner(BaseModel): + """ + BarSourceDataEmploymentHistoryArrayInner + """ # noqa: E501 + employer: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + end_date: Optional[datetime] = Field(default=None, alias="endDate") + start_date: Optional[datetime] = Field(default=None, alias="startDate") + __properties: ClassVar[List[str]] = ["employer", "endDate", "startDate"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'employer': 'employer', # noqa: E501 - 'end_date': 'endDate', # noqa: E501 - 'start_date': 'startDate', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, employer, end_date, start_date, *args, **kwargs): # noqa: E501 - """BarSourceDataEmploymentHistoryArrayInner - a model defined in OpenAPI - - Args: - employer (str, none_type): - end_date (datetime, none_type): - start_date (datetime, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataEmploymentHistoryArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.employer = employer - self.end_date = end_date - self.start_date = start_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, employer, end_date, start_date, *args, **kwargs): # noqa: E501 - """BarSourceDataEmploymentHistoryArrayInner - a model defined in OpenAPI - - Args: - employer (str, none_type): - end_date (datetime, none_type): - start_date (datetime, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if employer (nullable) is None + # and model_fields_set contains the field + if self.employer is None and "employer" in self.model_fields_set: + _dict['employer'] = None + + # set to None if end_date (nullable) is None + # and model_fields_set contains the field + if self.end_date is None and "end_date" in self.model_fields_set: + _dict['endDate'] = None + + # set to None if start_date (nullable) is None + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: + _dict['startDate'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataEmploymentHistoryArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "employer": obj.get("employer"), + "endDate": obj.get("endDate"), + "startDate": obj.get("startDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.employer = employer - self.end_date = end_date - self.start_date = start_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_fees_options_array_inner.py b/unicourt/model/bar_source_data_fees_options_array_inner.py index ef13d78..86c4938 100644 --- a/unicourt/model/bar_source_data_fees_options_array_inner.py +++ b/unicourt/model/bar_source_data_fees_options_array_inner.py @@ -1,308 +1,121 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class BarSourceDataFeesOptionsArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class BarSourceDataFeesOptionsArrayInner(BaseModel): """ + BarSourceDataFeesOptionsArrayInner + """ # noqa: E501 + contingency_fees: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="contingencyFees") + flat_fees: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="flatFees") + hourly_rate: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="hourlyRate") + payment_plans: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="paymentPlans") + sliding_scale_fees: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="slidingScaleFees") + __properties: ClassVar[List[str]] = ["contingencyFees", "flatFees", "hourlyRate", "paymentPlans", "slidingScaleFees"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('contingency_fees',): { - 'max_length': 250, - }, - ('flat_fees',): { - 'max_length': 250, - }, - ('hourly_rate',): { - 'max_length': 250, - }, - ('payment_plans',): { - 'max_length': 250, - }, - ('sliding_scale_fees',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataFeesOptionsArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'contingency_fees': (str, none_type,), # noqa: E501 - 'flat_fees': (str, none_type,), # noqa: E501 - 'hourly_rate': (str, none_type,), # noqa: E501 - 'payment_plans': (str, none_type,), # noqa: E501 - 'sliding_scale_fees': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'contingency_fees': 'contingencyFees', # noqa: E501 - 'flat_fees': 'flatFees', # noqa: E501 - 'hourly_rate': 'hourlyRate', # noqa: E501 - 'payment_plans': 'paymentPlans', # noqa: E501 - 'sliding_scale_fees': 'slidingScaleFees', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if contingency_fees (nullable) is None + # and model_fields_set contains the field + if self.contingency_fees is None and "contingency_fees" in self.model_fields_set: + _dict['contingencyFees'] = None + + # set to None if flat_fees (nullable) is None + # and model_fields_set contains the field + if self.flat_fees is None and "flat_fees" in self.model_fields_set: + _dict['flatFees'] = None + + # set to None if hourly_rate (nullable) is None + # and model_fields_set contains the field + if self.hourly_rate is None and "hourly_rate" in self.model_fields_set: + _dict['hourlyRate'] = None + + # set to None if payment_plans (nullable) is None + # and model_fields_set contains the field + if self.payment_plans is None and "payment_plans" in self.model_fields_set: + _dict['paymentPlans'] = None + + # set to None if sliding_scale_fees (nullable) is None + # and model_fields_set contains the field + if self.sliding_scale_fees is None and "sliding_scale_fees" in self.model_fields_set: + _dict['slidingScaleFees'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, contingency_fees, flat_fees, hourly_rate, payment_plans, sliding_scale_fees, *args, **kwargs): # noqa: E501 - """BarSourceDataFeesOptionsArrayInner - a model defined in OpenAPI - - Args: - contingency_fees (str, none_type): - flat_fees (str, none_type): - hourly_rate (str, none_type): - payment_plans (str, none_type): - sliding_scale_fees (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.contingency_fees = contingency_fees - self.flat_fees = flat_fees - self.hourly_rate = hourly_rate - self.payment_plans = payment_plans - self.sliding_scale_fees = sliding_scale_fees - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, contingency_fees, flat_fees, hourly_rate, payment_plans, sliding_scale_fees, *args, **kwargs): # noqa: E501 - """BarSourceDataFeesOptionsArrayInner - a model defined in OpenAPI - - Args: - contingency_fees (str, none_type): - flat_fees (str, none_type): - hourly_rate (str, none_type): - payment_plans (str, none_type): - sliding_scale_fees (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataFeesOptionsArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "contingencyFees": obj.get("contingencyFees"), + "flatFees": obj.get("flatFees"), + "hourlyRate": obj.get("hourlyRate"), + "paymentPlans": obj.get("paymentPlans"), + "slidingScaleFees": obj.get("slidingScaleFees") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.contingency_fees = contingency_fees - self.flat_fees = flat_fees - self.hourly_rate = hourly_rate - self.payment_plans = payment_plans - self.sliding_scale_fees = sliding_scale_fees - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_involvements_array_inner.py b/unicourt/model/bar_source_data_involvements_array_inner.py index 36b7205..3ac7c1b 100644 --- a/unicourt/model/bar_source_data_involvements_array_inner.py +++ b/unicourt/model/bar_source_data_involvements_array_inner.py @@ -1,290 +1,107 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataInvolvementsArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('name',): { - 'max_length': 500, - }, - ('position',): { - 'max_length': 250, - }, - ('type',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'name': (str, none_type,), # noqa: E501 - 'position': (str, none_type,), # noqa: E501 - 'type': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataInvolvementsArrayInner(BaseModel): + """ + BarSourceDataInvolvementsArrayInner + """ # noqa: E501 + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + position: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + type: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["name", "position", "type"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'name': 'name', # noqa: E501 - 'position': 'position', # noqa: E501 - 'type': 'type', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, position, type, *args, **kwargs): # noqa: E501 - """BarSourceDataInvolvementsArrayInner - a model defined in OpenAPI - - Args: - name (str, none_type): - position (str, none_type): - type (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataInvolvementsArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.position = position - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, position, type, *args, **kwargs): # noqa: E501 - """BarSourceDataInvolvementsArrayInner - a model defined in OpenAPI - - Args: - name (str, none_type): - position (str, none_type): - type (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if position (nullable) is None + # and model_fields_set contains the field + if self.position is None and "position" in self.model_fields_set: + _dict['position'] = None + + # set to None if type (nullable) is None + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: + _dict['type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataInvolvementsArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "position": obj.get("position"), + "type": obj.get("type") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.name = name - self.position = position - self.type = type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_law_school_array_inner.py b/unicourt/model/bar_source_data_law_school_array_inner.py index a50a054..215f630 100644 --- a/unicourt/model/bar_source_data_law_school_array_inner.py +++ b/unicourt/model/bar_source_data_law_school_array_inner.py @@ -1,281 +1,101 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataLawSchoolArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('law_school',): { - 'max_length': 250, - }, - ('law_school_graduated_date',): { - 'max_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'law_school': (str, none_type,), # noqa: E501 - 'law_school_graduated_date': (datetime, none_type,), # noqa: E501 - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataLawSchoolArrayInner(BaseModel): + """ + BarSourceDataLawSchoolArrayInner + """ # noqa: E501 + law_school: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="lawSchool") + law_school_graduated_date: Optional[datetime] = Field(default=None, alias="lawSchoolGraduatedDate") + __properties: ClassVar[List[str]] = ["lawSchool", "lawSchoolGraduatedDate"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'law_school': 'lawSchool', # noqa: E501 - 'law_school_graduated_date': 'lawSchoolGraduatedDate', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, law_school, law_school_graduated_date, *args, **kwargs): # noqa: E501 - """BarSourceDataLawSchoolArrayInner - a model defined in OpenAPI - - Args: - law_school (str, none_type): - law_school_graduated_date (datetime, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataLawSchoolArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.law_school = law_school - self.law_school_graduated_date = law_school_graduated_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, law_school, law_school_graduated_date, *args, **kwargs): # noqa: E501 - """BarSourceDataLawSchoolArrayInner - a model defined in OpenAPI - - Args: - law_school (str, none_type): - law_school_graduated_date (datetime, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if law_school (nullable) is None + # and model_fields_set contains the field + if self.law_school is None and "law_school" in self.model_fields_set: + _dict['lawSchool'] = None + + # set to None if law_school_graduated_date (nullable) is None + # and model_fields_set contains the field + if self.law_school_graduated_date is None and "law_school_graduated_date" in self.model_fields_set: + _dict['lawSchoolGraduatedDate'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataLawSchoolArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "lawSchool": obj.get("lawSchool"), + "lawSchoolGraduatedDate": obj.get("lawSchoolGraduatedDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.law_school = law_school - self.law_school_graduated_date = law_school_graduated_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_name.py b/unicourt/model/bar_source_data_name.py index 5909cad..5734656 100644 --- a/unicourt/model/bar_source_data_name.py +++ b/unicourt/model/bar_source_data_name.py @@ -1,317 +1,113 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class BarSourceDataName(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class BarSourceDataName(BaseModel): """ + BarSourceDataName + """ # noqa: E501 + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + first_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="firstName") + middle_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="middleName") + last_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="lastName") + prefix: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + suffix: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["name", "firstName", "middleName", "lastName", "prefix", "suffix"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('name',): { - 'max_length': 500, - }, - ('first_name',): { - 'max_length': 500, - }, - ('middle_name',): { - 'max_length': 500, - }, - ('last_name',): { - 'max_length': 500, - }, - ('prefix',): { - 'max_length': 250, - }, - ('suffix',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataName from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'name': (str,), # noqa: E501 - 'first_name': (str,), # noqa: E501 - 'middle_name': (str, none_type,), # noqa: E501 - 'last_name': (str,), # noqa: E501 - 'prefix': (str, none_type,), # noqa: E501 - 'suffix': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'first_name': 'firstName', # noqa: E501 - 'middle_name': 'middleName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - 'prefix': 'prefix', # noqa: E501 - 'suffix': 'suffix', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if middle_name (nullable) is None + # and model_fields_set contains the field + if self.middle_name is None and "middle_name" in self.model_fields_set: + _dict['middleName'] = None + + # set to None if prefix (nullable) is None + # and model_fields_set contains the field + if self.prefix is None and "prefix" in self.model_fields_set: + _dict['prefix'] = None + + # set to None if suffix (nullable) is None + # and model_fields_set contains the field + if self.suffix is None and "suffix" in self.model_fields_set: + _dict['suffix'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, first_name, middle_name, last_name, prefix, suffix, *args, **kwargs): # noqa: E501 - """BarSourceDataName - a model defined in OpenAPI - - Args: - name (str): - first_name (str): - middle_name (str, none_type): - last_name (str): - prefix (str, none_type): - suffix (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.prefix = prefix - self.suffix = suffix - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, first_name, middle_name, last_name, prefix, suffix, *args, **kwargs): # noqa: E501 - """BarSourceDataName - a model defined in OpenAPI - - Args: - name (str): - first_name (str): - middle_name (str, none_type): - last_name (str): - prefix (str, none_type): - suffix (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataName from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "firstName": obj.get("firstName"), + "middleName": obj.get("middleName"), + "lastName": obj.get("lastName"), + "prefix": obj.get("prefix"), + "suffix": obj.get("suffix") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.name = name - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.prefix = prefix - self.suffix = suffix - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_open_action_status_array_inner.py b/unicourt/model/bar_source_data_open_action_status_array_inner.py index 7ebd333..76a3cb4 100644 --- a/unicourt/model/bar_source_data_open_action_status_array_inner.py +++ b/unicourt/model/bar_source_data_open_action_status_array_inner.py @@ -1,281 +1,101 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataOpenActionStatusArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('date',): { - 'max_length': 25, - }, - ('reason',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'date': (datetime, none_type,), # noqa: E501 - 'reason': (str, none_type,), # noqa: E501 - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataOpenActionStatusArrayInner(BaseModel): + """ + BarSourceDataOpenActionStatusArrayInner + """ # noqa: E501 + date: Optional[datetime] = Field(default=None, alias="date") + reason: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["date", "reason"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'date': 'date', # noqa: E501 - 'reason': 'reason', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, date, reason, *args, **kwargs): # noqa: E501 - """BarSourceDataOpenActionStatusArrayInner - a model defined in OpenAPI - - Args: - date (datetime, none_type): - reason (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataOpenActionStatusArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.date = date - self.reason = reason - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, date, reason, *args, **kwargs): # noqa: E501 - """BarSourceDataOpenActionStatusArrayInner - a model defined in OpenAPI - - Args: - date (datetime, none_type): - reason (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if date (nullable) is None + # and model_fields_set contains the field + if self.date is None and "date" in self.model_fields_set: + _dict['date'] = None + + # set to None if reason (nullable) is None + # and model_fields_set contains the field + if self.reason is None and "reason" in self.model_fields_set: + _dict['reason'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataOpenActionStatusArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "date": obj.get("date"), + "reason": obj.get("reason") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.date = date - self.reason = reason - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_other_jurisdiction_array_inner.py b/unicourt/model/bar_source_data_other_jurisdiction_array_inner.py index d26e91a..8b3629c 100644 --- a/unicourt/model/bar_source_data_other_jurisdiction_array_inner.py +++ b/unicourt/model/bar_source_data_other_jurisdiction_array_inner.py @@ -1,281 +1,100 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataOtherJurisdictionArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('bar_number',): { - 'max_length': 250, - }, - ('state',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'bar_number': (str, none_type,), # noqa: E501 - 'state': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataOtherJurisdictionArrayInner(BaseModel): + """ + BarSourceDataOtherJurisdictionArrayInner + """ # noqa: E501 + bar_number: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="barNumber") + state: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["barNumber", "state"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'bar_number': 'barNumber', # noqa: E501 - 'state': 'state', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, bar_number, state, *args, **kwargs): # noqa: E501 - """BarSourceDataOtherJurisdictionArrayInner - a model defined in OpenAPI - - Args: - bar_number (str, none_type): - state (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataOtherJurisdictionArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.bar_number = bar_number - self.state = state - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, bar_number, state, *args, **kwargs): # noqa: E501 - """BarSourceDataOtherJurisdictionArrayInner - a model defined in OpenAPI - - Args: - bar_number (str, none_type): - state (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if bar_number (nullable) is None + # and model_fields_set contains the field + if self.bar_number is None and "bar_number" in self.model_fields_set: + _dict['barNumber'] = None + + # set to None if state (nullable) is None + # and model_fields_set contains the field + if self.state is None and "state" in self.model_fields_set: + _dict['state'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataOtherJurisdictionArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "barNumber": obj.get("barNumber"), + "state": obj.get("state") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.bar_number = bar_number - self.state = state - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_public_hearing_array_inner.py b/unicourt/model/bar_source_data_public_hearing_array_inner.py index 37662cc..6b978fd 100644 --- a/unicourt/model/bar_source_data_public_hearing_array_inner.py +++ b/unicourt/model/bar_source_data_public_hearing_array_inner.py @@ -1,308 +1,122 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class BarSourceDataPublicHearingArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class BarSourceDataPublicHearingArrayInner(BaseModel): """ + BarSourceDataPublicHearingArrayInner + """ # noqa: E501 + conduct: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + date: Optional[datetime] = Field(default=None, alias="date") + issued_by: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="issuedBy") + order: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + respondent: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["conduct", "date", "issuedBy", "order", "respondent"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('conduct',): { - 'max_length': 500, - }, - ('date',): { - 'max_length': 25, - }, - ('issued_by',): { - 'max_length': 250, - }, - ('order',): { - 'max_length': 250, - }, - ('respondent',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataPublicHearingArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'conduct': (str, none_type,), # noqa: E501 - 'date': (datetime, none_type,), # noqa: E501 - 'issued_by': (str, none_type,), # noqa: E501 - 'order': (str, none_type,), # noqa: E501 - 'respondent': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'conduct': 'conduct', # noqa: E501 - 'date': 'date', # noqa: E501 - 'issued_by': 'issuedBy', # noqa: E501 - 'order': 'order', # noqa: E501 - 'respondent': 'respondent', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if conduct (nullable) is None + # and model_fields_set contains the field + if self.conduct is None and "conduct" in self.model_fields_set: + _dict['conduct'] = None + + # set to None if date (nullable) is None + # and model_fields_set contains the field + if self.date is None and "date" in self.model_fields_set: + _dict['date'] = None + + # set to None if issued_by (nullable) is None + # and model_fields_set contains the field + if self.issued_by is None and "issued_by" in self.model_fields_set: + _dict['issuedBy'] = None + + # set to None if order (nullable) is None + # and model_fields_set contains the field + if self.order is None and "order" in self.model_fields_set: + _dict['order'] = None + + # set to None if respondent (nullable) is None + # and model_fields_set contains the field + if self.respondent is None and "respondent" in self.model_fields_set: + _dict['respondent'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, conduct, date, issued_by, order, respondent, *args, **kwargs): # noqa: E501 - """BarSourceDataPublicHearingArrayInner - a model defined in OpenAPI - - Args: - conduct (str, none_type): - date (datetime, none_type): - issued_by (str, none_type): - order (str, none_type): - respondent (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.conduct = conduct - self.date = date - self.issued_by = issued_by - self.order = order - self.respondent = respondent - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, conduct, date, issued_by, order, respondent, *args, **kwargs): # noqa: E501 - """BarSourceDataPublicHearingArrayInner - a model defined in OpenAPI - - Args: - conduct (str, none_type): - date (datetime, none_type): - issued_by (str, none_type): - order (str, none_type): - respondent (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataPublicHearingArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "conduct": obj.get("conduct"), + "date": obj.get("date"), + "issuedBy": obj.get("issuedBy"), + "order": obj.get("order"), + "respondent": obj.get("respondent") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.conduct = conduct - self.date = date - self.issued_by = issued_by - self.order = order - self.respondent = respondent - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_reason_for_inactivation.py b/unicourt/model/bar_source_data_reason_for_inactivation.py index de2a84b..9bb3054 100644 --- a/unicourt/model/bar_source_data_reason_for_inactivation.py +++ b/unicourt/model/bar_source_data_reason_for_inactivation.py @@ -1,281 +1,100 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataReasonForInactivation(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('case_number',): { - 'max_length': 250, - }, - ('link',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'case_number': (str, none_type,), # noqa: E501 - 'link': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataReasonForInactivation(BaseModel): + """ + BarSourceDataReasonForInactivation + """ # noqa: E501 + case_number: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="caseNumber") + link: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["caseNumber", "link"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'case_number': 'caseNumber', # noqa: E501 - 'link': 'link', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_number, link, *args, **kwargs): # noqa: E501 - """BarSourceDataReasonForInactivation - a model defined in OpenAPI - - Args: - case_number (str, none_type): - link (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataReasonForInactivation from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.case_number = case_number - self.link = link - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_number, link, *args, **kwargs): # noqa: E501 - """BarSourceDataReasonForInactivation - a model defined in OpenAPI - - Args: - case_number (str, none_type): - link (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if case_number (nullable) is None + # and model_fields_set contains the field + if self.case_number is None and "case_number" in self.model_fields_set: + _dict['caseNumber'] = None + + # set to None if link (nullable) is None + # and model_fields_set contains the field + if self.link is None and "link" in self.model_fields_set: + _dict['link'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataReasonForInactivation from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "caseNumber": obj.get("caseNumber"), + "link": obj.get("link") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.case_number = case_number - self.link = link - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_related_cases_array_inner.py b/unicourt/model/bar_source_data_related_cases_array_inner.py index 86e799c..84227c3 100644 --- a/unicourt/model/bar_source_data_related_cases_array_inner.py +++ b/unicourt/model/bar_source_data_related_cases_array_inner.py @@ -1,282 +1,100 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataRelatedCasesArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('case_id',): { - 'max_length': 250, - 'min_length': 1, - }, - ('case_details',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'case_id': (str, none_type,), # noqa: E501 - 'case_details': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataRelatedCasesArrayInner(BaseModel): + """ + BarSourceDataRelatedCasesArrayInner + """ # noqa: E501 + case_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=250)]] = Field(default=None, alias="caseId") + case_details: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="caseDetails") + __properties: ClassVar[List[str]] = ["caseId", "caseDetails"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'case_id': 'caseId', # noqa: E501 - 'case_details': 'caseDetails', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_id, case_details, *args, **kwargs): # noqa: E501 - """BarSourceDataRelatedCasesArrayInner - a model defined in OpenAPI - - Args: - case_id (str, none_type): - case_details (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataRelatedCasesArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.case_id = case_id - self.case_details = case_details - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_id, case_details, *args, **kwargs): # noqa: E501 - """BarSourceDataRelatedCasesArrayInner - a model defined in OpenAPI - - Args: - case_id (str, none_type): - case_details (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if case_id (nullable) is None + # and model_fields_set contains the field + if self.case_id is None and "case_id" in self.model_fields_set: + _dict['caseId'] = None + + # set to None if case_details (nullable) is None + # and model_fields_set contains the field + if self.case_details is None and "case_details" in self.model_fields_set: + _dict['caseDetails'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataRelatedCasesArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "caseId": obj.get("caseId"), + "caseDetails": obj.get("caseDetails") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.case_id = case_id - self.case_details = case_details - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_source_info.py b/unicourt/model/bar_source_data_source_info.py index f2e4c8f..4bd6ec3 100644 --- a/unicourt/model/bar_source_data_source_info.py +++ b/unicourt/model/bar_source_data_source_info.py @@ -1,272 +1,93 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataSourceInfo(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('url',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'url': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataSourceInfo(BaseModel): + """ + BarSourceDataSourceInfo + """ # noqa: E501 + url: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + __properties: ClassVar[List[str]] = ["url"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'url': 'url', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, url, *args, **kwargs): # noqa: E501 - """BarSourceDataSourceInfo - a model defined in OpenAPI - - Args: - url (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataSourceInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self.url = url - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - @convert_js_args_to_python_args - def __init__(self, url, *args, **kwargs): # noqa: E501 - """BarSourceDataSourceInfo - a model defined in OpenAPI + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if url (nullable) is None + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: + _dict['url'] = None - Args: - url (str, none_type): + return _dict - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataSourceInfo from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "url": obj.get("url") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.url = url - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_statewide_grievance_committee_history_array_inner.py b/unicourt/model/bar_source_data_statewide_grievance_committee_history_array_inner.py index 533b8a3..3dacc0d 100644 --- a/unicourt/model/bar_source_data_statewide_grievance_committee_history_array_inner.py +++ b/unicourt/model/bar_source_data_statewide_grievance_committee_history_array_inner.py @@ -1,299 +1,115 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner(BaseModel): """ + BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner + """ # noqa: E501 + final_decision: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="finalDecision") + final_decision_date: Optional[datetime] = Field(default=None, alias="finalDecisionDate") + grievance_complaint_number: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="grievanceComplaintNumber") + public_comments: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, alias="publicComments") + __properties: ClassVar[List[str]] = ["finalDecision", "finalDecisionDate", "grievanceComplaintNumber", "publicComments"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('final_decision',): { - 'max_length': 250, - }, - ('final_decision_date',): { - 'max_length': 25, - }, - ('grievance_complaint_number',): { - 'max_length': 250, - }, - ('public_comments',): { - 'max_length': 1000, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'final_decision': (str, none_type,), # noqa: E501 - 'final_decision_date': (datetime, none_type,), # noqa: E501 - 'grievance_complaint_number': (str, none_type,), # noqa: E501 - 'public_comments': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'final_decision': 'finalDecision', # noqa: E501 - 'final_decision_date': 'finalDecisionDate', # noqa: E501 - 'grievance_complaint_number': 'grievanceComplaintNumber', # noqa: E501 - 'public_comments': 'publicComments', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if final_decision (nullable) is None + # and model_fields_set contains the field + if self.final_decision is None and "final_decision" in self.model_fields_set: + _dict['finalDecision'] = None + + # set to None if final_decision_date (nullable) is None + # and model_fields_set contains the field + if self.final_decision_date is None and "final_decision_date" in self.model_fields_set: + _dict['finalDecisionDate'] = None + + # set to None if grievance_complaint_number (nullable) is None + # and model_fields_set contains the field + if self.grievance_complaint_number is None and "grievance_complaint_number" in self.model_fields_set: + _dict['grievanceComplaintNumber'] = None + + # set to None if public_comments (nullable) is None + # and model_fields_set contains the field + if self.public_comments is None and "public_comments" in self.model_fields_set: + _dict['publicComments'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, final_decision, final_decision_date, grievance_complaint_number, public_comments, *args, **kwargs): # noqa: E501 - """BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner - a model defined in OpenAPI - - Args: - final_decision (str, none_type): - final_decision_date (datetime, none_type): - grievance_complaint_number (str, none_type): - public_comments (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.final_decision = final_decision - self.final_decision_date = final_decision_date - self.grievance_complaint_number = grievance_complaint_number - self.public_comments = public_comments - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, final_decision, final_decision_date, grievance_complaint_number, public_comments, *args, **kwargs): # noqa: E501 - """BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner - a model defined in OpenAPI - - Args: - final_decision (str, none_type): - final_decision_date (datetime, none_type): - grievance_complaint_number (str, none_type): - public_comments (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataStatewideGrievanceCommitteeHistoryArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "finalDecision": obj.get("finalDecision"), + "finalDecisionDate": obj.get("finalDecisionDate"), + "grievanceComplaintNumber": obj.get("grievanceComplaintNumber"), + "publicComments": obj.get("publicComments") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.final_decision = final_decision - self.final_decision_date = final_decision_date - self.grievance_complaint_number = grievance_complaint_number - self.public_comments = public_comments - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_status_history_array_inner.py b/unicourt/model/bar_source_data_status_history_array_inner.py index 987b6e3..9682bc3 100644 --- a/unicourt/model/bar_source_data_status_history_array_inner.py +++ b/unicourt/model/bar_source_data_status_history_array_inner.py @@ -1,281 +1,101 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataStatusHistoryArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('effective_date',): { - 'max_length': 25, - }, - ('status_change',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'effective_date': (datetime, none_type,), # noqa: E501 - 'status_change': (str, none_type,), # noqa: E501 - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataStatusHistoryArrayInner(BaseModel): + """ + BarSourceDataStatusHistoryArrayInner + """ # noqa: E501 + effective_date: Optional[datetime] = Field(default=None, alias="effectiveDate") + status_change: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="statusChange") + __properties: ClassVar[List[str]] = ["effectiveDate", "statusChange"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'effective_date': 'effectiveDate', # noqa: E501 - 'status_change': 'statusChange', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, effective_date, status_change, *args, **kwargs): # noqa: E501 - """BarSourceDataStatusHistoryArrayInner - a model defined in OpenAPI - - Args: - effective_date (datetime, none_type): - status_change (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataStatusHistoryArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.effective_date = effective_date - self.status_change = status_change - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, effective_date, status_change, *args, **kwargs): # noqa: E501 - """BarSourceDataStatusHistoryArrayInner - a model defined in OpenAPI - - Args: - effective_date (datetime, none_type): - status_change (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if effective_date (nullable) is None + # and model_fields_set contains the field + if self.effective_date is None and "effective_date" in self.model_fields_set: + _dict['effectiveDate'] = None + + # set to None if status_change (nullable) is None + # and model_fields_set contains the field + if self.status_change is None and "status_change" in self.model_fields_set: + _dict['statusChange'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataStatusHistoryArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "effectiveDate": obj.get("effectiveDate"), + "statusChange": obj.get("statusChange") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.effective_date = effective_date - self.status_change = status_change - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/bar_source_data_ten_year_discipline_array_inner.py b/unicourt/model/bar_source_data_ten_year_discipline_array_inner.py index c0aaa3e..3e85174 100644 --- a/unicourt/model/bar_source_data_ten_year_discipline_array_inner.py +++ b/unicourt/model/bar_source_data_ten_year_discipline_array_inner.py @@ -1,290 +1,108 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BarSourceDataTenYearDisciplineArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('action_date',): { - 'max_length': 25, - }, - ('description',): { - 'max_length': 250, - }, - ('reference',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'action_date': (datetime, none_type,), # noqa: E501 - 'description': (str, none_type,), # noqa: E501 - 'reference': (str, none_type,), # noqa: E501 - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BarSourceDataTenYearDisciplineArrayInner(BaseModel): + """ + BarSourceDataTenYearDisciplineArrayInner + """ # noqa: E501 + action_date: Optional[datetime] = Field(default=None, alias="actionDate") + description: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + reference: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["actionDate", "description", "reference"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'action_date': 'actionDate', # noqa: E501 - 'description': 'description', # noqa: E501 - 'reference': 'reference', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, action_date, description, reference, *args, **kwargs): # noqa: E501 - """BarSourceDataTenYearDisciplineArrayInner - a model defined in OpenAPI - - Args: - action_date (datetime, none_type): - description (str, none_type): - reference (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BarSourceDataTenYearDisciplineArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.action_date = action_date - self.description = description - self.reference = reference - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, action_date, description, reference, *args, **kwargs): # noqa: E501 - """BarSourceDataTenYearDisciplineArrayInner - a model defined in OpenAPI - - Args: - action_date (datetime, none_type): - description (str, none_type): - reference (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if action_date (nullable) is None + # and model_fields_set contains the field + if self.action_date is None and "action_date" in self.model_fields_set: + _dict['actionDate'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if reference (nullable) is None + # and model_fields_set contains the field + if self.reference is None and "reference" in self.model_fields_set: + _dict['reference'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BarSourceDataTenYearDisciplineArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "actionDate": obj.get("actionDate"), + "description": obj.get("description"), + "reference": obj.get("reference") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.action_date = action_date - self.description = description - self.reference = reference - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/billing_cycle_usage_response.py b/unicourt/model/billing_cycle_usage_response.py index 80d7495..fb68691 100644 --- a/unicourt/model/billing_cycle_usage_response.py +++ b/unicourt/model/billing_cycle_usage_response.py @@ -1,329 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.billing_cycle_usage_response_api_calls_billable import BillingCycleUsageResponseApiCallsBillable - from unicourt.model.billing_cycle_usage_response_api_calls_credited import BillingCycleUsageResponseApiCallsCredited - from unicourt.model.billing_cycle_usage_response_api_calls_made import BillingCycleUsageResponseApiCallsMade - from unicourt.model.billing_cycle_usage_response_billing_cycle import BillingCycleUsageResponseBillingCycle - globals()['BillingCycleUsageResponseApiCallsBillable'] = BillingCycleUsageResponseApiCallsBillable - globals()['BillingCycleUsageResponseApiCallsCredited'] = BillingCycleUsageResponseApiCallsCredited - globals()['BillingCycleUsageResponseApiCallsMade'] = BillingCycleUsageResponseApiCallsMade - globals()['BillingCycleUsageResponseBillingCycle'] = BillingCycleUsageResponseBillingCycle - - -class BillingCycleUsageResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'billing_cycle': (BillingCycleUsageResponseBillingCycle,), # noqa: E501 - 'days': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'api_usage': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'api_calls_made': (BillingCycleUsageResponseApiCallsMade,), # noqa: E501 - 'api_calls_credited': (BillingCycleUsageResponseApiCallsCredited,), # noqa: E501 - 'api_calls_billable': (BillingCycleUsageResponseApiCallsBillable,), # noqa: E501 - 'total_cases_tracked': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'billing_cycle': 'billingCycle', # noqa: E501 - 'days': 'days', # noqa: E501 - 'api_usage': 'apiUsage', # noqa: E501 - 'api_calls_made': 'apiCallsMade', # noqa: E501 - 'api_calls_credited': 'apiCallsCredited', # noqa: E501 - 'api_calls_billable': 'apiCallsBillable', # noqa: E501 - 'total_cases_tracked': 'totalCasesTracked', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.billing_cycle_usage_response_api_calls_billable import BillingCycleUsageResponseApiCallsBillable +from unicourt.model.billing_cycle_usage_response_api_calls_credited import BillingCycleUsageResponseApiCallsCredited +from unicourt.model.billing_cycle_usage_response_api_calls_made import BillingCycleUsageResponseApiCallsMade +from unicourt.model.billing_cycle_usage_response_billing_cycle import BillingCycleUsageResponseBillingCycle +from typing import Optional, Set +from typing_extensions import Self + +class BillingCycleUsageResponse(BaseModel): + """ + BillingCycleUsageResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default='BillingCycleUsageResponse', description="Name of the object.") + billing_cycle: Optional[BillingCycleUsageResponseBillingCycle] = Field(default=None, alias="billingCycle") + days: Optional[Dict[str, Any]] = Field(default=None, description="Billing cycle days.") + api_usage: Optional[Dict[str, Any]] = Field(default=None, description="Billing cycle apiUsage.", alias="apiUsage") + api_calls_made: Optional[BillingCycleUsageResponseApiCallsMade] = Field(default=None, alias="apiCallsMade") + api_calls_credited: Optional[BillingCycleUsageResponseApiCallsCredited] = Field(default=None, alias="apiCallsCredited") + api_calls_billable: Optional[BillingCycleUsageResponseApiCallsBillable] = Field(default=None, alias="apiCallsBillable") + total_cases_tracked: Optional[StrictInt] = Field(default=None, description="Total number of successful case tracks.", alias="totalCasesTracked") + __properties: ClassVar[List[str]] = ["object", "billingCycle", "days", "apiUsage", "apiCallsMade", "apiCallsCredited", "apiCallsBillable", "totalCasesTracked"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, billing_cycle, days, api_usage, api_calls_made, api_calls_credited, api_calls_billable, total_cases_tracked, *args, **kwargs): # noqa: E501 - """BillingCycleUsageResponse - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BillingCycleUsageResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - billing_cycle (BillingCycleUsageResponseBillingCycle): - days ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Billing cycle days. - api_usage ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Billing cycle apiUsage. - api_calls_made (BillingCycleUsageResponseApiCallsMade): - api_calls_credited (BillingCycleUsageResponseApiCallsCredited): - api_calls_billable (BillingCycleUsageResponseApiCallsBillable): - total_cases_tracked (int): Total number of successful case tracks. - - Keyword Args: - object (str): Name of the object.. defaults to "BillingCycleUsageResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "BillingCycleUsageResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.billing_cycle = billing_cycle - self.days = days - self.api_usage = api_usage - self.api_calls_made = api_calls_made - self.api_calls_credited = api_calls_credited - self.api_calls_billable = api_calls_billable - self.total_cases_tracked = total_cases_tracked - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, billing_cycle, days, api_usage, api_calls_made, api_calls_credited, api_calls_billable, total_cases_tracked, *args, **kwargs): # noqa: E501 - """BillingCycleUsageResponse - a model defined in OpenAPI - - Args: - billing_cycle (BillingCycleUsageResponseBillingCycle): - days ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Billing cycle days. - api_usage ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Billing cycle apiUsage. - api_calls_made (BillingCycleUsageResponseApiCallsMade): - api_calls_credited (BillingCycleUsageResponseApiCallsCredited): - api_calls_billable (BillingCycleUsageResponseApiCallsBillable): - total_cases_tracked (int): Total number of successful case tracks. - - Keyword Args: - object (str): Name of the object.. defaults to "BillingCycleUsageResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of billing_cycle + if self.billing_cycle: + _dict['billingCycle'] = self.billing_cycle.to_dict() + # override the default output from pydantic by calling `to_dict()` of api_calls_made + if self.api_calls_made: + _dict['apiCallsMade'] = self.api_calls_made.to_dict() + # override the default output from pydantic by calling `to_dict()` of api_calls_credited + if self.api_calls_credited: + _dict['apiCallsCredited'] = self.api_calls_credited.to_dict() + # override the default output from pydantic by calling `to_dict()` of api_calls_billable + if self.api_calls_billable: + _dict['apiCallsBillable'] = self.api_calls_billable.to_dict() + return _dict - object = kwargs.get('object', "BillingCycleUsageResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BillingCycleUsageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'BillingCycleUsageResponse', + "billingCycle": BillingCycleUsageResponseBillingCycle.from_dict(obj["billingCycle"]) if obj.get("billingCycle") is not None else None, + "days": obj.get("days"), + "apiUsage": obj.get("apiUsage"), + "apiCallsMade": BillingCycleUsageResponseApiCallsMade.from_dict(obj["apiCallsMade"]) if obj.get("apiCallsMade") is not None else None, + "apiCallsCredited": BillingCycleUsageResponseApiCallsCredited.from_dict(obj["apiCallsCredited"]) if obj.get("apiCallsCredited") is not None else None, + "apiCallsBillable": BillingCycleUsageResponseApiCallsBillable.from_dict(obj["apiCallsBillable"]) if obj.get("apiCallsBillable") is not None else None, + "totalCasesTracked": obj.get("totalCasesTracked") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.billing_cycle = billing_cycle - self.days = days - self.api_usage = api_usage - self.api_calls_made = api_calls_made - self.api_calls_credited = api_calls_credited - self.api_calls_billable = api_calls_billable - self.total_cases_tracked = total_cases_tracked - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/billing_cycle_usage_response_api_calls_billable.py b/unicourt/model/billing_cycle_usage_response_api_calls_billable.py index c2cce7e..6486d8f 100644 --- a/unicourt/model/billing_cycle_usage_response_api_calls_billable.py +++ b/unicourt/model/billing_cycle_usage_response_api_calls_billable.py @@ -1,279 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BillingCycleUsageResponseApiCallsBillable(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('last_updated',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'count': (int,), # noqa: E501 - 'last_updated': (datetime, none_type,), # noqa: E501 - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BillingCycleUsageResponseApiCallsBillable(BaseModel): + """ + Total number of API calls billed for the billing cycle. + """ # noqa: E501 + count: Optional[StrictInt] = Field(default=None, description="Total API calls billed for the billing cycle") + last_updated: Optional[datetime] = Field(default=None, description="Last Updated date and time for the field apiCallsBillable", alias="lastUpdated") + __properties: ClassVar[List[str]] = ["count", "lastUpdated"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'count': 'count', # noqa: E501 - 'last_updated': 'lastUpdated', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, count, last_updated, *args, **kwargs): # noqa: E501 - """BillingCycleUsageResponseApiCallsBillable - a model defined in OpenAPI - - Args: - count (int): Total API calls billed for the billing cycle - last_updated (datetime, none_type): Last Updated date and time for the field apiCallsBillable - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BillingCycleUsageResponseApiCallsBillable from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self.count = count - self.last_updated = last_updated - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - @convert_js_args_to_python_args - def __init__(self, count, last_updated, *args, **kwargs): # noqa: E501 - """BillingCycleUsageResponseApiCallsBillable - a model defined in OpenAPI + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if last_updated (nullable) is None + # and model_fields_set contains the field + if self.last_updated is None and "last_updated" in self.model_fields_set: + _dict['lastUpdated'] = None - Args: - count (int): Total API calls billed for the billing cycle - last_updated (datetime, none_type): Last Updated date and time for the field apiCallsBillable + return _dict - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BillingCycleUsageResponseApiCallsBillable from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "count": obj.get("count"), + "lastUpdated": obj.get("lastUpdated") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.count = count - self.last_updated = last_updated - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/billing_cycle_usage_response_api_calls_credited.py b/unicourt/model/billing_cycle_usage_response_api_calls_credited.py index e0be0c6..eb37be1 100644 --- a/unicourt/model/billing_cycle_usage_response_api_calls_credited.py +++ b/unicourt/model/billing_cycle_usage_response_api_calls_credited.py @@ -1,279 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BillingCycleUsageResponseApiCallsCredited(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('last_updated',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'count': (int,), # noqa: E501 - 'last_updated': (datetime, none_type,), # noqa: E501 - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BillingCycleUsageResponseApiCallsCredited(BaseModel): + """ + Total number of callbackFailures including caseUpdate, caseDocumentOrder and caseExport for the billing cycle. + """ # noqa: E501 + count: Optional[StrictInt] = Field(default=None, description="Total API calls credited back for the billing cycle") + last_updated: Optional[datetime] = Field(default=None, description="Last Updated date and time for the field apiCallsCredited", alias="lastUpdated") + __properties: ClassVar[List[str]] = ["count", "lastUpdated"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'count': 'count', # noqa: E501 - 'last_updated': 'lastUpdated', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, count, last_updated, *args, **kwargs): # noqa: E501 - """BillingCycleUsageResponseApiCallsCredited - a model defined in OpenAPI - - Args: - count (int): Total API calls credited back for the billing cycle - last_updated (datetime, none_type): Last Updated date and time for the field apiCallsCredited - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BillingCycleUsageResponseApiCallsCredited from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self.count = count - self.last_updated = last_updated - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - @convert_js_args_to_python_args - def __init__(self, count, last_updated, *args, **kwargs): # noqa: E501 - """BillingCycleUsageResponseApiCallsCredited - a model defined in OpenAPI + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if last_updated (nullable) is None + # and model_fields_set contains the field + if self.last_updated is None and "last_updated" in self.model_fields_set: + _dict['lastUpdated'] = None - Args: - count (int): Total API calls credited back for the billing cycle - last_updated (datetime, none_type): Last Updated date and time for the field apiCallsCredited + return _dict - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BillingCycleUsageResponseApiCallsCredited from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "count": obj.get("count"), + "lastUpdated": obj.get("lastUpdated") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.count = count - self.last_updated = last_updated - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/billing_cycle_usage_response_api_calls_made.py b/unicourt/model/billing_cycle_usage_response_api_calls_made.py index 5b6c805..dfd5762 100644 --- a/unicourt/model/billing_cycle_usage_response_api_calls_made.py +++ b/unicourt/model/billing_cycle_usage_response_api_calls_made.py @@ -1,279 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BillingCycleUsageResponseApiCallsMade(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('last_updated',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'count': (int,), # noqa: E501 - 'last_updated': (datetime, none_type,), # noqa: E501 - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BillingCycleUsageResponseApiCallsMade(BaseModel): + """ + Total API calls made for the billing cycle. + """ # noqa: E501 + count: Optional[StrictInt] = Field(default=None, description="Total API calls made for the billing cycle") + last_updated: Optional[datetime] = Field(default=None, description="Last Updated date and time for the field apiCallsMade", alias="lastUpdated") + __properties: ClassVar[List[str]] = ["count", "lastUpdated"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'count': 'count', # noqa: E501 - 'last_updated': 'lastUpdated', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, count, last_updated, *args, **kwargs): # noqa: E501 - """BillingCycleUsageResponseApiCallsMade - a model defined in OpenAPI - - Args: - count (int): Total API calls made for the billing cycle - last_updated (datetime, none_type): Last Updated date and time for the field apiCallsMade - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BillingCycleUsageResponseApiCallsMade from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self.count = count - self.last_updated = last_updated - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - @convert_js_args_to_python_args - def __init__(self, count, last_updated, *args, **kwargs): # noqa: E501 - """BillingCycleUsageResponseApiCallsMade - a model defined in OpenAPI + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if last_updated (nullable) is None + # and model_fields_set contains the field + if self.last_updated is None and "last_updated" in self.model_fields_set: + _dict['lastUpdated'] = None - Args: - count (int): Total API calls made for the billing cycle - last_updated (datetime, none_type): Last Updated date and time for the field apiCallsMade + return _dict - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BillingCycleUsageResponseApiCallsMade from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "count": obj.get("count"), + "lastUpdated": obj.get("lastUpdated") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.count = count - self.last_updated = last_updated - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/billing_cycle_usage_response_billing_cycle.py b/unicourt/model/billing_cycle_usage_response_billing_cycle.py index 0ecc4a8..a1312cd 100644 --- a/unicourt/model/billing_cycle_usage_response_billing_cycle.py +++ b/unicourt/model/billing_cycle_usage_response_billing_cycle.py @@ -1,283 +1,90 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BillingCycleUsageResponseBillingCycle(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('start_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('end_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'start_date': (datetime,), # noqa: E501 - 'end_date': (datetime,), # noqa: E501 - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BillingCycleUsageResponseBillingCycle(BaseModel): + """ + StartDate and endDate of the billing cycle. + """ # noqa: E501 + start_date: Optional[datetime] = Field(default=None, description="Start date of the billing cycle.", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="End date of the billing cycle.", alias="endDate") + __properties: ClassVar[List[str]] = ["startDate", "endDate"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'start_date': 'startDate', # noqa: E501 - 'end_date': 'endDate', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, start_date, end_date, *args, **kwargs): # noqa: E501 - """BillingCycleUsageResponseBillingCycle - a model defined in OpenAPI - - Args: - start_date (datetime): Start date of the billing cycle. - end_date (datetime): End date of the billing cycle. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BillingCycleUsageResponseBillingCycle from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.start_date = start_date - self.end_date = end_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, start_date, end_date, *args, **kwargs): # noqa: E501 - """BillingCycleUsageResponseBillingCycle - a model defined in OpenAPI + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - Args: - start_date (datetime): Start date of the billing cycle. - end_date (datetime): End date of the billing cycle. + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BillingCycleUsageResponseBillingCycle from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.start_date = start_date - self.end_date = end_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/billing_cycles_response.py b/unicourt/model/billing_cycles_response.py index 19dfa94..3552909 100644 --- a/unicourt/model/billing_cycles_response.py +++ b/unicourt/model/billing_cycles_response.py @@ -1,285 +1,90 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class BillingCyclesResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 21, - 'min_length': 21, - }, - ('billing_cycle_array',): { - 'max_items': 12, - 'min_items': 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'billing_cycle_array': ([str, none_type], none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class BillingCyclesResponse(BaseModel): + """ + BillingCyclesResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=21, strict=True, max_length=21)]] = Field(default='BillingCyclesResponse', description="Name of the object.") + billing_cycle_array: Optional[Annotated[List[Optional[Annotated[str, Field(min_length=22, strict=True, max_length=22)]]], Field(min_length=0, max_length=12)]] = Field(default=None, description="Array of previous 12 Billing Cycles.", alias="billingCycleArray") + __properties: ClassVar[List[str]] = ["object", "billingCycleArray"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'object': 'object', # noqa: E501 - 'billing_cycle_array': 'billingCycleArray', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, billing_cycle_array, *args, **kwargs): # noqa: E501 - """BillingCyclesResponse - a model defined in OpenAPI - - Args: - billing_cycle_array ([str, none_type], none_type): Array of previous 12 Billing Cycles. - - Keyword Args: - object (str): Name of the object.. defaults to "BillingCyclesResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BillingCyclesResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "BillingCyclesResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.billing_cycle_array = billing_cycle_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, billing_cycle_array, *args, **kwargs): # noqa: E501 - """BillingCyclesResponse - a model defined in OpenAPI + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - Args: - billing_cycle_array ([str, none_type], none_type): Array of previous 12 Billing Cycles. + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict - Keyword Args: - object (str): Name of the object.. defaults to "BillingCyclesResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BillingCyclesResponse from a dict""" + if obj is None: + return None - object = kwargs.get('object', "BillingCyclesResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'BillingCyclesResponse', + "billingCycleArray": obj.get("billingCycleArray") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.billing_cycle_array = billing_cycle_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/callback_list_response.py b/unicourt/model/callback_list_response.py index 25ea5ce..ec34b4d 100644 --- a/unicourt/model/callback_list_response.py +++ b/unicourt/model/callback_list_response.py @@ -1,295 +1,99 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.callback_list_response_case_document_order_callbacks import CallbackListResponseCaseDocumentOrderCallbacks - from unicourt.model.callback_list_response_case_export_callbacks import CallbackListResponseCaseExportCallbacks - globals()['CallbackListResponseCaseDocumentOrderCallbacks'] = CallbackListResponseCaseDocumentOrderCallbacks - globals()['CallbackListResponseCaseExportCallbacks'] = CallbackListResponseCaseExportCallbacks - - -class CallbackListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 20, - 'min_length': 20, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_document_order_callbacks': (CallbackListResponseCaseDocumentOrderCallbacks,), # noqa: E501 - 'case_export_callbacks': (CallbackListResponseCaseExportCallbacks,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.callback_list_response_case_document_order_callbacks import CallbackListResponseCaseDocumentOrderCallbacks +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class CallbackListResponse(BaseModel): + """ + CallbackListResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=20, strict=True, max_length=20)]] = Field(default='CallbackListResponse', description="Name of the object.") + case_document_order_callbacks: Optional[CallbackListResponseCaseDocumentOrderCallbacks] = Field(default=None, alias="caseDocumentOrderCallbacks") + case_export_callbacks: Optional[CallbackListResponseCaseDocumentOrderCallbacks] = Field(default=None, alias="caseExportCallbacks") + __properties: ClassVar[List[str]] = ["object", "caseDocumentOrderCallbacks", "caseExportCallbacks"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_document_order_callbacks': 'caseDocumentOrderCallbacks', # noqa: E501 - 'case_export_callbacks': 'caseExportCallbacks', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_document_order_callbacks, case_export_callbacks, *args, **kwargs): # noqa: E501 - """CallbackListResponse - a model defined in OpenAPI - - Args: - case_document_order_callbacks (CallbackListResponseCaseDocumentOrderCallbacks): - case_export_callbacks (CallbackListResponseCaseExportCallbacks): - - Keyword Args: - object (str): Name of the object.. defaults to "CallbackListResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CallbackListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "CallbackListResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_document_order_callbacks = case_document_order_callbacks - self.case_export_callbacks = case_export_callbacks - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_document_order_callbacks, case_export_callbacks, *args, **kwargs): # noqa: E501 - """CallbackListResponse - a model defined in OpenAPI - - Args: - case_document_order_callbacks (CallbackListResponseCaseDocumentOrderCallbacks): - case_export_callbacks (CallbackListResponseCaseExportCallbacks): - - Keyword Args: - object (str): Name of the object.. defaults to "CallbackListResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_document_order_callbacks + if self.case_document_order_callbacks: + _dict['caseDocumentOrderCallbacks'] = self.case_document_order_callbacks.to_dict() + # override the default output from pydantic by calling `to_dict()` of case_export_callbacks + if self.case_export_callbacks: + _dict['caseExportCallbacks'] = self.case_export_callbacks.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CallbackListResponse from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CallbackListResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CallbackListResponse', + "caseDocumentOrderCallbacks": CallbackListResponseCaseDocumentOrderCallbacks.from_dict(obj["caseDocumentOrderCallbacks"]) if obj.get("caseDocumentOrderCallbacks") is not None else None, + "caseExportCallbacks": CallbackListResponseCaseDocumentOrderCallbacks.from_dict(obj["caseExportCallbacks"]) if obj.get("caseExportCallbacks") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_document_order_callbacks = case_document_order_callbacks - self.case_export_callbacks = case_export_callbacks - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/callback_list_response_case_document_order_callbacks.py b/unicourt/model/callback_list_response_case_document_order_callbacks.py index 188227d..4d3b1fc 100644 --- a/unicourt/model/callback_list_response_case_document_order_callbacks.py +++ b/unicourt/model/callback_list_response_case_document_order_callbacks.py @@ -1,279 +1,90 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class CallbackListResponseCaseDocumentOrderCallbacks(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('link',): { - 'max_length': 1024, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'count': (int,), # noqa: E501 - 'link': (str,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class CallbackListResponseCaseDocumentOrderCallbacks(BaseModel): + """ + CallbackListResponseCaseDocumentOrderCallbacks + """ # noqa: E501 + count: Optional[StrictInt] = None + link: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = None + __properties: ClassVar[List[str]] = ["count", "link"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'count': 'count', # noqa: E501 - 'link': 'link', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, count, link, *args, **kwargs): # noqa: E501 - """CallbackListResponseCaseDocumentOrderCallbacks - a model defined in OpenAPI - - Args: - count (int): - link (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CallbackListResponseCaseDocumentOrderCallbacks from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.count = count - self.link = link - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, count, link, *args, **kwargs): # noqa: E501 - """CallbackListResponseCaseDocumentOrderCallbacks - a model defined in OpenAPI + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - Args: - count (int): - link (str): + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CallbackListResponseCaseDocumentOrderCallbacks from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "count": obj.get("count"), + "link": obj.get("link") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.count = count - self.link = link - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/callback_list_response_case_export_callbacks.py b/unicourt/model/callback_list_response_case_export_callbacks.py deleted file mode 100644 index 3ce2679..0000000 --- a/unicourt/model/callback_list_response_case_export_callbacks.py +++ /dev/null @@ -1,279 +0,0 @@ -""" - UniCourt Enterprise APIs - - # noqa: E501 - - The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class CallbackListResponseCaseExportCallbacks(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('link',): { - 'max_length': 1024, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'count': (int,), # noqa: E501 - 'link': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'count': 'count', # noqa: E501 - 'link': 'link', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} - - @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, count, link, *args, **kwargs): # noqa: E501 - """CallbackListResponseCaseExportCallbacks - a model defined in OpenAPI - - Args: - count (int): - link (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.count = count - self.link = link - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, count, link, *args, **kwargs): # noqa: E501 - """CallbackListResponseCaseExportCallbacks - a model defined in OpenAPI - - Args: - count (int): - link (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.count = count - self.link = link - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case.py b/unicourt/model/case.py index 14c2073..b3cab67 100644 --- a/unicourt/model/case.py +++ b/unicourt/model/case.py @@ -1,539 +1,257 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.attorneys import Attorneys - from unicourt.model.case_cause_of_action import CaseCauseOfAction - from unicourt.model.case_charge import CaseCharge - from unicourt.model.case_documents import CaseDocuments - from unicourt.model.case_stats import CaseStats - from unicourt.model.case_status import CaseStatus - from unicourt.model.case_type import CaseType - from unicourt.model.court import Court - from unicourt.model.court_location import CourtLocation - from unicourt.model.docket_entries import DocketEntries - from unicourt.model.hearings import Hearings - from unicourt.model.judges import Judges - from unicourt.model.parties import Parties - from unicourt.model.related_cases import RelatedCases - from unicourt.model.source_case_data import SourceCaseData - globals()['Attorneys'] = Attorneys - globals()['CaseCauseOfAction'] = CaseCauseOfAction - globals()['CaseCharge'] = CaseCharge - globals()['CaseDocuments'] = CaseDocuments - globals()['CaseStats'] = CaseStats - globals()['CaseStatus'] = CaseStatus - globals()['CaseType'] = CaseType - globals()['Court'] = Court - globals()['CourtLocation'] = CourtLocation - globals()['DocketEntries'] = DocketEntries - globals()['Hearings'] = Hearings - globals()['Judges'] = Judges - globals()['Parties'] = Parties - globals()['RelatedCases'] = RelatedCases - globals()['SourceCaseData'] = SourceCaseData - - -class Case(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('source_data_status',): { - 'None': None, - 'NO_LONGER_AVAILABLE_IN_COURT': "NO_LONGER_AVAILABLE_IN_COURT", - 'SOURCE_DEPRECATED': "SOURCE_DEPRECATED", - 'NULL': "null", - }, - } - - validations = { - ('object',): { - 'max_length': 4, - 'min_length': 4, - }, - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('url',): { - 'max_length': 500, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('case_name',): { - 'max_length': 250, - }, - ('filed_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('court_service_status_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('court_service_status_api',): { - 'max_length': 250, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date_with_updates',): { - 'max_length': 25, - 'min_length': 25, - }, - ('participants_last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('export_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_id': (str,), # noqa: E501 - 'url': (str, none_type,), # noqa: E501 - 'case_number': (str,), # noqa: E501 - 'case_name': (str, none_type,), # noqa: E501 - 'filed_date': (datetime,), # noqa: E501 - 'has_only_meta_info': (bool,), # noqa: E501 - 'court_service_status_id': (str, none_type,), # noqa: E501 - 'court_service_status_api': (str, none_type,), # noqa: E501 - 'court': (Court,), # noqa: E501 - 'court_location': (CourtLocation,), # noqa: E501 - 'case_type': (CaseType,), # noqa: E501 - 'charge_array': ([CaseCharge],), # noqa: E501 - 'case_status': (CaseStatus,), # noqa: E501 - 'cause_of_action_array': ([CaseCauseOfAction],), # noqa: E501 - 'first_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date_with_updates': (datetime,), # noqa: E501 - 'participants_last_fetch_date': (datetime, none_type,), # noqa: E501 - 'source_data_status': (str, none_type,), # noqa: E501 - 'source_case_data': (SourceCaseData,), # noqa: E501 - 'has_documents_with_preview': (bool,), # noqa: E501 - 'export_api': (str,), # noqa: E501 - 'case_stats': (CaseStats,), # noqa: E501 - 'parties': (Parties,), # noqa: E501 - 'attorneys': (Attorneys,), # noqa: E501 - 'judges': (Judges,), # noqa: E501 - 'docket_entries': (DocketEntries,), # noqa: E501 - 'hearings': (Hearings,), # noqa: E501 - 'case_documents': (CaseDocuments,), # noqa: E501 - 'related_cases': (RelatedCases,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_id': 'caseId', # noqa: E501 - 'url': 'url', # noqa: E501 - 'case_number': 'caseNumber', # noqa: E501 - 'case_name': 'caseName', # noqa: E501 - 'filed_date': 'filedDate', # noqa: E501 - 'has_only_meta_info': 'hasOnlyMetaInfo', # noqa: E501 - 'court_service_status_id': 'courtServiceStatusId', # noqa: E501 - 'court_service_status_api': 'courtServiceStatusAPI', # noqa: E501 - 'court': 'court', # noqa: E501 - 'court_location': 'courtLocation', # noqa: E501 - 'case_type': 'caseType', # noqa: E501 - 'charge_array': 'chargeArray', # noqa: E501 - 'case_status': 'caseStatus', # noqa: E501 - 'cause_of_action_array': 'causeOfActionArray', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'last_fetch_date_with_updates': 'lastFetchDateWithUpdates', # noqa: E501 - 'participants_last_fetch_date': 'participantsLastFetchDate', # noqa: E501 - 'source_data_status': 'sourceDataStatus', # noqa: E501 - 'source_case_data': 'sourceCaseData', # noqa: E501 - 'has_documents_with_preview': 'hasDocumentsWithPreview', # noqa: E501 - 'export_api': 'exportAPI', # noqa: E501 - 'case_stats': 'caseStats', # noqa: E501 - 'parties': 'parties', # noqa: E501 - 'attorneys': 'attorneys', # noqa: E501 - 'judges': 'judges', # noqa: E501 - 'docket_entries': 'docketEntries', # noqa: E501 - 'hearings': 'hearings', # noqa: E501 - 'case_documents': 'caseDocuments', # noqa: E501 - 'related_cases': 'relatedCases', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.attorneys import Attorneys +from unicourt.model.case_cause_of_action import CaseCauseOfAction +from unicourt.model.case_charge import CaseCharge +from unicourt.model.case_documents import CaseDocuments +from unicourt.model.case_stats import CaseStats +from unicourt.model.case_status import CaseStatus +from unicourt.model.case_type import CaseType +from unicourt.model.court import Court +from unicourt.model.court_location import CourtLocation +from unicourt.model.docket_entries import DocketEntries +from unicourt.model.hearings import Hearings +from unicourt.model.judges import Judges +from unicourt.model.parties import Parties +from unicourt.model.related_cases import RelatedCases +from unicourt.model.source_case_data import SourceCaseData +from typing import Optional, Set +from typing_extensions import Self + +class Case(BaseModel): + """ + Case + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]] = Field(default='Case', description="Name of the object") + case_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Unique identifier of Case.", alias="caseId") + url: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="URL to the case page in UniCourt Application.") + case_number: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]] = Field(default=None, description="Case number as provided by Court.", alias="caseNumber") + case_name: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="Case name as provided by Court.", alias="caseName") + filed_date: Optional[datetime] = Field(default=None, description="Filing date for the case provided by the Court. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz", alias="filedDate") + has_only_meta_info: Optional[StrictBool] = Field(default=None, description="This field determines if this case object has only meta information. If the value is true and if the full information is required you would need to call the updateCase API.", alias="hasOnlyMetaInfo") + court_service_status_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Court Service Status ID of the requested case where we can use it to get the service status", alias="courtServiceStatusId") + court_service_status_api: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="API to get the service statuses of the given case.", alias="courtServiceStatusAPI") + court: Optional[Court] = None + court_location: Optional[CourtLocation] = Field(default=None, alias="courtLocation") + case_type: Optional[CaseType] = Field(default=None, alias="caseType") + charge_array: Optional[List[CaseCharge]] = Field(default=None, description="Array of charges that are added to this case.", alias="chargeArray") + case_status: Optional[CaseStatus] = Field(default=None, alias="caseStatus") + cause_of_action_array: Optional[List[CaseCauseOfAction]] = Field(default=None, description="Array of cause of Actions that are added to this case.", alias="causeOfActionArray") + first_fetch_date: Optional[datetime] = Field(default=None, description="The date and time when the case was first fetched from the Court. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz,.", alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, description="The date and time when the case was last fetched from the Court. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, Note: It is not necessary that every time the case is fetched from Court we find changes in the case information. It could be that we already have the latest information from the Court and no changes exist.", alias="lastFetchDate") + last_fetch_date_with_updates: Optional[datetime] = Field(default=None, description="The date and time when the case was last fetched from the Court where we found changes in the case information. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz,", alias="lastFetchDateWithUpdates") + participants_last_fetch_date: Optional[datetime] = Field(default=None, description="The date and time when parties/attorneys were last updated from the Court. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, Note: This is currently applicable for Federal PACER cases since we have an option to exclude parties and fetch only latest docket entries when updating cases to save PACER fees.", alias="participantsLastFetchDate") + source_data_status: Optional[StrictStr] = Field(default=None, description="The status of source data of case. If the value of sourceDataStatus is SOURCE_DEPRECATED then it means that the Case has been migrated from old court site to a new court site and the data being shown in the API response is from a old court site. If the sourceDataStatus is NO_LONGER_AVAILABLE_IN_COURT then it means that a particular case is invalid in the court site.", alias="sourceDataStatus") + source_case_data: Optional[SourceCaseData] = Field(default=None, alias="sourceCaseData") + has_documents_with_preview: Optional[StrictBool] = Field(default=None, description="This field will be set to TRUE if atleast one document has a preview.", alias="hasDocumentsWithPreview") + export_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="When a case is beyond the threshold of entities we provide this link so that the user can request and get all the data of the case with one additional call. This data will be zipped and sent via a webhoook.", alias="exportAPI") + case_stats: Optional[CaseStats] = Field(default=None, alias="caseStats") + parties: Optional[Parties] = None + attorneys: Optional[Attorneys] = None + judges: Optional[Judges] = None + docket_entries: Optional[DocketEntries] = Field(default=None, alias="docketEntries") + hearings: Optional[Hearings] = None + case_documents: Optional[CaseDocuments] = Field(default=None, alias="caseDocuments") + related_cases: Optional[RelatedCases] = Field(default=None, alias="relatedCases") + __properties: ClassVar[List[str]] = ["object", "caseId", "url", "caseNumber", "caseName", "filedDate", "hasOnlyMetaInfo", "courtServiceStatusId", "courtServiceStatusAPI", "court", "courtLocation", "caseType", "chargeArray", "caseStatus", "causeOfActionArray", "firstFetchDate", "lastFetchDate", "lastFetchDateWithUpdates", "participantsLastFetchDate", "sourceDataStatus", "sourceCaseData", "hasDocumentsWithPreview", "exportAPI", "caseStats", "parties", "attorneys", "judges", "docketEntries", "hearings", "caseDocuments", "relatedCases"] + + @field_validator('source_data_status') + def source_data_status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['NO_LONGER_AVAILABLE_IN_COURT', 'null']): + raise ValueError("must be one of enum values ('NO_LONGER_AVAILABLE_IN_COURT', 'null')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_id, url, case_number, case_name, filed_date, has_only_meta_info, court_service_status_id, court_service_status_api, court, court_location, case_type, charge_array, case_status, cause_of_action_array, first_fetch_date, last_fetch_date, last_fetch_date_with_updates, participants_last_fetch_date, source_data_status, source_case_data, has_documents_with_preview, export_api, case_stats, parties, attorneys, judges, docket_entries, hearings, case_documents, related_cases, *args, **kwargs): # noqa: E501 - """Case - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Case from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - case_id (str): Unique identifier of Case. - url (str, none_type): URL to the case page in UniCourt Application. - case_number (str): Case number as provided by Court. - case_name (str, none_type): Case name as provided by Court. - filed_date (datetime): Filing date for the case provided by the Court. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz - has_only_meta_info (bool): This field determines if this case object has only meta information. If the value is true and if the full information is required you would need to call the updateCase API. - court_service_status_id (str, none_type): Court Service Status ID of the requested case where we can use it to get the service status - court_service_status_api (str, none_type): API to get the service statuses of the given case. - court (Court): - court_location (CourtLocation): - case_type (CaseType): - charge_array ([CaseCharge]): Array of charges that are added to this case. - case_status (CaseStatus): - cause_of_action_array ([CaseCauseOfAction]): Array of cause of Actions that are added to this case. - first_fetch_date (datetime): The date and time when the case was first fetched from the Court. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz,. - last_fetch_date (datetime): The date and time when the case was last fetched from the Court. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, Note: It is not necessary that every time the case is fetched from Court we find changes in the case information. It could be that we already have the latest information from the Court and no changes exist. - last_fetch_date_with_updates (datetime): The date and time when the case was last fetched from the Court where we found changes in the case information. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, - participants_last_fetch_date (datetime, none_type): The date and time when parties/attorneys were last updated from the Court. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, Note: This is currently applicable for Federal PACER cases since we have an option to exclude parties and fetch only latest docket entries when updating cases to save PACER fees. - source_data_status (str, none_type): The status of source data of case. If the value of sourceDataStatus is SOURCE_DEPRECATED then it means that the Case has been migrated from old court site to a new court site and the data being shown in the API response is from a old court site. If the sourceDataStatus is NO_LONGER_AVAILABLE_IN_COURT then it means that a particular case is invalid in the court site. - source_case_data (SourceCaseData): - has_documents_with_preview (bool): This field will be set to TRUE if atleast one document has a preview. - export_api (str): When a case is beyond the threshold of entities we provide this link so that the user can request and get all the data of the case with one additional call. This data will be zipped and sent via a webhoook. - case_stats (CaseStats): - parties (Parties): - attorneys (Attorneys): - judges (Judges): - docket_entries (DocketEntries): - hearings (Hearings): - case_documents (CaseDocuments): - related_cases (RelatedCases): - - Keyword Args: - object (str): Name of the object. defaults to "Case" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "Case") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_id = case_id - self.url = url - self.case_number = case_number - self.case_name = case_name - self.filed_date = filed_date - self.has_only_meta_info = has_only_meta_info - self.court_service_status_id = court_service_status_id - self.court_service_status_api = court_service_status_api - self.court = court - self.court_location = court_location - self.case_type = case_type - self.charge_array = charge_array - self.case_status = case_status - self.cause_of_action_array = cause_of_action_array - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.last_fetch_date_with_updates = last_fetch_date_with_updates - self.participants_last_fetch_date = participants_last_fetch_date - self.source_data_status = source_data_status - self.source_case_data = source_case_data - self.has_documents_with_preview = has_documents_with_preview - self.export_api = export_api - self.case_stats = case_stats - self.parties = parties - self.attorneys = attorneys - self.judges = judges - self.docket_entries = docket_entries - self.hearings = hearings - self.case_documents = case_documents - self.related_cases = related_cases - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_id, url, case_number, case_name, filed_date, has_only_meta_info, court_service_status_id, court_service_status_api, court, court_location, case_type, charge_array, case_status, cause_of_action_array, first_fetch_date, last_fetch_date, last_fetch_date_with_updates, participants_last_fetch_date, source_data_status, source_case_data, has_documents_with_preview, export_api, case_stats, parties, attorneys, judges, docket_entries, hearings, case_documents, related_cases, *args, **kwargs): # noqa: E501 - """Case - a model defined in OpenAPI - - Args: - case_id (str): Unique identifier of Case. - url (str, none_type): URL to the case page in UniCourt Application. - case_number (str): Case number as provided by Court. - case_name (str, none_type): Case name as provided by Court. - filed_date (datetime): Filing date for the case provided by the Court. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz - has_only_meta_info (bool): This field determines if this case object has only meta information. If the value is true and if the full information is required you would need to call the updateCase API. - court_service_status_id (str, none_type): Court Service Status ID of the requested case where we can use it to get the service status - court_service_status_api (str, none_type): API to get the service statuses of the given case. - court (Court): - court_location (CourtLocation): - case_type (CaseType): - charge_array ([CaseCharge]): Array of charges that are added to this case. - case_status (CaseStatus): - cause_of_action_array ([CaseCauseOfAction]): Array of cause of Actions that are added to this case. - first_fetch_date (datetime): The date and time when the case was first fetched from the Court. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz,. - last_fetch_date (datetime): The date and time when the case was last fetched from the Court. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, Note: It is not necessary that every time the case is fetched from Court we find changes in the case information. It could be that we already have the latest information from the Court and no changes exist. - last_fetch_date_with_updates (datetime): The date and time when the case was last fetched from the Court where we found changes in the case information. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, - participants_last_fetch_date (datetime, none_type): The date and time when parties/attorneys were last updated from the Court. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, Note: This is currently applicable for Federal PACER cases since we have an option to exclude parties and fetch only latest docket entries when updating cases to save PACER fees. - source_data_status (str, none_type): The status of source data of case. If the value of sourceDataStatus is SOURCE_DEPRECATED then it means that the Case has been migrated from old court site to a new court site and the data being shown in the API response is from a old court site. If the sourceDataStatus is NO_LONGER_AVAILABLE_IN_COURT then it means that a particular case is invalid in the court site. - source_case_data (SourceCaseData): - has_documents_with_preview (bool): This field will be set to TRUE if atleast one document has a preview. - export_api (str): When a case is beyond the threshold of entities we provide this link so that the user can request and get all the data of the case with one additional call. This data will be zipped and sent via a webhoook. - case_stats (CaseStats): - parties (Parties): - attorneys (Attorneys): - judges (Judges): - docket_entries (DocketEntries): - hearings (Hearings): - case_documents (CaseDocuments): - related_cases (RelatedCases): - - Keyword Args: - object (str): Name of the object. defaults to "Case" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of court + if self.court: + _dict['court'] = self.court.to_dict() + # override the default output from pydantic by calling `to_dict()` of court_location + if self.court_location: + _dict['courtLocation'] = self.court_location.to_dict() + # override the default output from pydantic by calling `to_dict()` of case_type + if self.case_type: + _dict['caseType'] = self.case_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in charge_array (list) + _items = [] + if self.charge_array: + for _item in self.charge_array: + if _item: + _items.append(_item.to_dict()) + _dict['chargeArray'] = _items + # override the default output from pydantic by calling `to_dict()` of case_status + if self.case_status: + _dict['caseStatus'] = self.case_status.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in cause_of_action_array (list) + _items = [] + if self.cause_of_action_array: + for _item in self.cause_of_action_array: + if _item: + _items.append(_item.to_dict()) + _dict['causeOfActionArray'] = _items + # override the default output from pydantic by calling `to_dict()` of source_case_data + if self.source_case_data: + _dict['sourceCaseData'] = self.source_case_data.to_dict() + # override the default output from pydantic by calling `to_dict()` of case_stats + if self.case_stats: + _dict['caseStats'] = self.case_stats.to_dict() + # override the default output from pydantic by calling `to_dict()` of parties + if self.parties: + _dict['parties'] = self.parties.to_dict() + # override the default output from pydantic by calling `to_dict()` of attorneys + if self.attorneys: + _dict['attorneys'] = self.attorneys.to_dict() + # override the default output from pydantic by calling `to_dict()` of judges + if self.judges: + _dict['judges'] = self.judges.to_dict() + # override the default output from pydantic by calling `to_dict()` of docket_entries + if self.docket_entries: + _dict['docketEntries'] = self.docket_entries.to_dict() + # override the default output from pydantic by calling `to_dict()` of hearings + if self.hearings: + _dict['hearings'] = self.hearings.to_dict() + # override the default output from pydantic by calling `to_dict()` of case_documents + if self.case_documents: + _dict['caseDocuments'] = self.case_documents.to_dict() + # override the default output from pydantic by calling `to_dict()` of related_cases + if self.related_cases: + _dict['relatedCases'] = self.related_cases.to_dict() + # set to None if url (nullable) is None + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: + _dict['url'] = None + + # set to None if case_name (nullable) is None + # and model_fields_set contains the field + if self.case_name is None and "case_name" in self.model_fields_set: + _dict['caseName'] = None + + # set to None if court_service_status_id (nullable) is None + # and model_fields_set contains the field + if self.court_service_status_id is None and "court_service_status_id" in self.model_fields_set: + _dict['courtServiceStatusId'] = None + + # set to None if court_service_status_api (nullable) is None + # and model_fields_set contains the field + if self.court_service_status_api is None and "court_service_status_api" in self.model_fields_set: + _dict['courtServiceStatusAPI'] = None + + # set to None if participants_last_fetch_date (nullable) is None + # and model_fields_set contains the field + if self.participants_last_fetch_date is None and "participants_last_fetch_date" in self.model_fields_set: + _dict['participantsLastFetchDate'] = None + + # set to None if source_data_status (nullable) is None + # and model_fields_set contains the field + if self.source_data_status is None and "source_data_status" in self.model_fields_set: + _dict['sourceDataStatus'] = None + + return _dict - object = kwargs.get('object', "Case") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Case from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Case', + "caseId": obj.get("caseId"), + "url": obj.get("url"), + "caseNumber": obj.get("caseNumber"), + "caseName": obj.get("caseName"), + "filedDate": obj.get("filedDate"), + "hasOnlyMetaInfo": obj.get("hasOnlyMetaInfo"), + "courtServiceStatusId": obj.get("courtServiceStatusId"), + "courtServiceStatusAPI": obj.get("courtServiceStatusAPI"), + "court": Court.from_dict(obj["court"]) if obj.get("court") is not None else None, + "courtLocation": CourtLocation.from_dict(obj["courtLocation"]) if obj.get("courtLocation") is not None else None, + "caseType": CaseType.from_dict(obj["caseType"]) if obj.get("caseType") is not None else None, + "chargeArray": [CaseCharge.from_dict(_item) for _item in obj["chargeArray"]] if obj.get("chargeArray") is not None else None, + "caseStatus": CaseStatus.from_dict(obj["caseStatus"]) if obj.get("caseStatus") is not None else None, + "causeOfActionArray": [CaseCauseOfAction.from_dict(_item) for _item in obj["causeOfActionArray"]] if obj.get("causeOfActionArray") is not None else None, + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate"), + "lastFetchDateWithUpdates": obj.get("lastFetchDateWithUpdates"), + "participantsLastFetchDate": obj.get("participantsLastFetchDate"), + "sourceDataStatus": obj.get("sourceDataStatus"), + "sourceCaseData": SourceCaseData.from_dict(obj["sourceCaseData"]) if obj.get("sourceCaseData") is not None else None, + "hasDocumentsWithPreview": obj.get("hasDocumentsWithPreview"), + "exportAPI": obj.get("exportAPI"), + "caseStats": CaseStats.from_dict(obj["caseStats"]) if obj.get("caseStats") is not None else None, + "parties": Parties.from_dict(obj["parties"]) if obj.get("parties") is not None else None, + "attorneys": Attorneys.from_dict(obj["attorneys"]) if obj.get("attorneys") is not None else None, + "judges": Judges.from_dict(obj["judges"]) if obj.get("judges") is not None else None, + "docketEntries": DocketEntries.from_dict(obj["docketEntries"]) if obj.get("docketEntries") is not None else None, + "hearings": Hearings.from_dict(obj["hearings"]) if obj.get("hearings") is not None else None, + "caseDocuments": CaseDocuments.from_dict(obj["caseDocuments"]) if obj.get("caseDocuments") is not None else None, + "relatedCases": RelatedCases.from_dict(obj["relatedCases"]) if obj.get("relatedCases") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_id = case_id - self.url = url - self.case_number = case_number - self.case_name = case_name - self.filed_date = filed_date - self.has_only_meta_info = has_only_meta_info - self.court_service_status_id = court_service_status_id - self.court_service_status_api = court_service_status_api - self.court = court - self.court_location = court_location - self.case_type = case_type - self.charge_array = charge_array - self.case_status = case_status - self.cause_of_action_array = cause_of_action_array - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.last_fetch_date_with_updates = last_fetch_date_with_updates - self.participants_last_fetch_date = participants_last_fetch_date - self.source_data_status = source_data_status - self.source_case_data = source_case_data - self.has_documents_with_preview = has_documents_with_preview - self.export_api = export_api - self.case_stats = case_stats - self.parties = parties - self.attorneys = attorneys - self.judges = judges - self.docket_entries = docket_entries - self.hearings = hearings - self.case_documents = case_documents - self.related_cases = related_cases - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_analytics_api.py b/unicourt/model/case_analytics_api.py index 802bd81..e6b5f18 100644 --- a/unicourt/model/case_analytics_api.py +++ b/unicourt/model/case_analytics_api.py @@ -1,379 +1,122 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class CaseAnalyticsAPI(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 16, - }, - ('case_count_analytics_by_court_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_court_type_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_court_system_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_court_location_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_jurisdiction_geo_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_area_of_law_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_case_class_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_case_type_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_case_type_group_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_party_role_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_party_role_group_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'case_count_analytics_by_court_api': (str,), # noqa: E501 - 'case_count_analytics_by_court_type_api': (str,), # noqa: E501 - 'case_count_analytics_by_court_system_api': (str,), # noqa: E501 - 'case_count_analytics_by_court_location_api': (str,), # noqa: E501 - 'case_count_analytics_by_jurisdiction_geo_api': (str,), # noqa: E501 - 'case_count_analytics_by_area_of_law_api': (str,), # noqa: E501 - 'case_count_analytics_by_case_class_api': (str,), # noqa: E501 - 'case_count_analytics_by_case_type_api': (str,), # noqa: E501 - 'case_count_analytics_by_case_type_group_api': (str,), # noqa: E501 - 'case_count_analytics_by_party_role_api': (str, none_type,), # noqa: E501 - 'case_count_analytics_by_party_role_group_api': (str, none_type,), # noqa: E501 - 'total_cases': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_count_analytics_by_court_api': 'caseCountAnalyticsByCourtAPI', # noqa: E501 - 'case_count_analytics_by_court_type_api': 'caseCountAnalyticsByCourtTypeAPI', # noqa: E501 - 'case_count_analytics_by_court_system_api': 'caseCountAnalyticsByCourtSystemAPI', # noqa: E501 - 'case_count_analytics_by_court_location_api': 'caseCountAnalyticsByCourtLocationAPI', # noqa: E501 - 'case_count_analytics_by_jurisdiction_geo_api': 'caseCountAnalyticsByJurisdictionGeoAPI', # noqa: E501 - 'case_count_analytics_by_area_of_law_api': 'caseCountAnalyticsByAreaOfLawAPI', # noqa: E501 - 'case_count_analytics_by_case_class_api': 'caseCountAnalyticsByCaseClassAPI', # noqa: E501 - 'case_count_analytics_by_case_type_api': 'caseCountAnalyticsByCaseTypeAPI', # noqa: E501 - 'case_count_analytics_by_case_type_group_api': 'caseCountAnalyticsByCaseTypeGroupAPI', # noqa: E501 - 'case_count_analytics_by_party_role_api': 'caseCountAnalyticsByPartyRoleAPI', # noqa: E501 - 'case_count_analytics_by_party_role_group_api': 'caseCountAnalyticsByPartyRoleGroupAPI', # noqa: E501 - 'total_cases': 'totalCases', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseAnalyticsAPI(BaseModel): + """ + Provides Court Data per State Jurisdiction for an entity. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=16)]] = 'CaseAnalyticsAPI' + case_count_analytics_by_court_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByCourtAPI") + case_count_analytics_by_court_type_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByCourtTypeAPI") + case_count_analytics_by_court_system_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByCourtSystemAPI") + case_count_analytics_by_court_location_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByCourtLocationAPI") + case_count_analytics_by_jurisdiction_geo_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByJurisdictionGeoAPI") + case_count_analytics_by_area_of_law_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByAreaOfLawAPI") + case_count_analytics_by_case_class_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByCaseClassAPI") + case_count_analytics_by_case_type_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByCaseTypeAPI") + case_count_analytics_by_case_type_group_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByCaseTypeGroupAPI") + case_count_analytics_by_party_role_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByPartyRoleAPI") + case_count_analytics_by_party_role_group_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByPartyRoleGroupAPI") + total_cases: Optional[StrictInt] = Field(default=None, alias="totalCases") + __properties: ClassVar[List[str]] = ["object", "caseCountAnalyticsByCourtAPI", "caseCountAnalyticsByCourtTypeAPI", "caseCountAnalyticsByCourtSystemAPI", "caseCountAnalyticsByCourtLocationAPI", "caseCountAnalyticsByJurisdictionGeoAPI", "caseCountAnalyticsByAreaOfLawAPI", "caseCountAnalyticsByCaseClassAPI", "caseCountAnalyticsByCaseTypeAPI", "caseCountAnalyticsByCaseTypeGroupAPI", "caseCountAnalyticsByPartyRoleAPI", "caseCountAnalyticsByPartyRoleGroupAPI", "totalCases"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_count_analytics_by_court_api, case_count_analytics_by_court_type_api, case_count_analytics_by_court_system_api, case_count_analytics_by_court_location_api, case_count_analytics_by_jurisdiction_geo_api, case_count_analytics_by_area_of_law_api, case_count_analytics_by_case_class_api, case_count_analytics_by_case_type_api, case_count_analytics_by_case_type_group_api, case_count_analytics_by_party_role_api, case_count_analytics_by_party_role_group_api, total_cases, *args, **kwargs): # noqa: E501 - """CaseAnalyticsAPI - a model defined in OpenAPI - - Args: - case_count_analytics_by_court_api (str): - case_count_analytics_by_court_type_api (str): - case_count_analytics_by_court_system_api (str): - case_count_analytics_by_court_location_api (str): - case_count_analytics_by_jurisdiction_geo_api (str): - case_count_analytics_by_area_of_law_api (str): - case_count_analytics_by_case_class_api (str): - case_count_analytics_by_case_type_api (str): - case_count_analytics_by_case_type_group_api (str): - case_count_analytics_by_party_role_api (str, none_type): - case_count_analytics_by_party_role_group_api (str, none_type): - total_cases (int): - - Keyword Args: - object (str): defaults to "CaseAnalyticsAPI" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseAnalyticsAPI from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "CaseAnalyticsAPI") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_count_analytics_by_court_api = case_count_analytics_by_court_api - self.case_count_analytics_by_court_type_api = case_count_analytics_by_court_type_api - self.case_count_analytics_by_court_system_api = case_count_analytics_by_court_system_api - self.case_count_analytics_by_court_location_api = case_count_analytics_by_court_location_api - self.case_count_analytics_by_jurisdiction_geo_api = case_count_analytics_by_jurisdiction_geo_api - self.case_count_analytics_by_area_of_law_api = case_count_analytics_by_area_of_law_api - self.case_count_analytics_by_case_class_api = case_count_analytics_by_case_class_api - self.case_count_analytics_by_case_type_api = case_count_analytics_by_case_type_api - self.case_count_analytics_by_case_type_group_api = case_count_analytics_by_case_type_group_api - self.case_count_analytics_by_party_role_api = case_count_analytics_by_party_role_api - self.case_count_analytics_by_party_role_group_api = case_count_analytics_by_party_role_group_api - self.total_cases = total_cases - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_count_analytics_by_court_api, case_count_analytics_by_court_type_api, case_count_analytics_by_court_system_api, case_count_analytics_by_court_location_api, case_count_analytics_by_jurisdiction_geo_api, case_count_analytics_by_area_of_law_api, case_count_analytics_by_case_class_api, case_count_analytics_by_case_type_api, case_count_analytics_by_case_type_group_api, case_count_analytics_by_party_role_api, case_count_analytics_by_party_role_group_api, total_cases, *args, **kwargs): # noqa: E501 - """CaseAnalyticsAPI - a model defined in OpenAPI - - Args: - case_count_analytics_by_court_api (str): - case_count_analytics_by_court_type_api (str): - case_count_analytics_by_court_system_api (str): - case_count_analytics_by_court_location_api (str): - case_count_analytics_by_jurisdiction_geo_api (str): - case_count_analytics_by_area_of_law_api (str): - case_count_analytics_by_case_class_api (str): - case_count_analytics_by_case_type_api (str): - case_count_analytics_by_case_type_group_api (str): - case_count_analytics_by_party_role_api (str, none_type): - case_count_analytics_by_party_role_group_api (str, none_type): - total_cases (int): - - Keyword Args: - object (str): defaults to "CaseAnalyticsAPI" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if case_count_analytics_by_party_role_api (nullable) is None + # and model_fields_set contains the field + if self.case_count_analytics_by_party_role_api is None and "case_count_analytics_by_party_role_api" in self.model_fields_set: + _dict['caseCountAnalyticsByPartyRoleAPI'] = None + + # set to None if case_count_analytics_by_party_role_group_api (nullable) is None + # and model_fields_set contains the field + if self.case_count_analytics_by_party_role_group_api is None and "case_count_analytics_by_party_role_group_api" in self.model_fields_set: + _dict['caseCountAnalyticsByPartyRoleGroupAPI'] = None + + return _dict - object = kwargs.get('object', "CaseAnalyticsAPI") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseAnalyticsAPI from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseAnalyticsAPI', + "caseCountAnalyticsByCourtAPI": obj.get("caseCountAnalyticsByCourtAPI"), + "caseCountAnalyticsByCourtTypeAPI": obj.get("caseCountAnalyticsByCourtTypeAPI"), + "caseCountAnalyticsByCourtSystemAPI": obj.get("caseCountAnalyticsByCourtSystemAPI"), + "caseCountAnalyticsByCourtLocationAPI": obj.get("caseCountAnalyticsByCourtLocationAPI"), + "caseCountAnalyticsByJurisdictionGeoAPI": obj.get("caseCountAnalyticsByJurisdictionGeoAPI"), + "caseCountAnalyticsByAreaOfLawAPI": obj.get("caseCountAnalyticsByAreaOfLawAPI"), + "caseCountAnalyticsByCaseClassAPI": obj.get("caseCountAnalyticsByCaseClassAPI"), + "caseCountAnalyticsByCaseTypeAPI": obj.get("caseCountAnalyticsByCaseTypeAPI"), + "caseCountAnalyticsByCaseTypeGroupAPI": obj.get("caseCountAnalyticsByCaseTypeGroupAPI"), + "caseCountAnalyticsByPartyRoleAPI": obj.get("caseCountAnalyticsByPartyRoleAPI"), + "caseCountAnalyticsByPartyRoleGroupAPI": obj.get("caseCountAnalyticsByPartyRoleGroupAPI"), + "totalCases": obj.get("totalCases") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_count_analytics_by_court_api = case_count_analytics_by_court_api - self.case_count_analytics_by_court_type_api = case_count_analytics_by_court_type_api - self.case_count_analytics_by_court_system_api = case_count_analytics_by_court_system_api - self.case_count_analytics_by_court_location_api = case_count_analytics_by_court_location_api - self.case_count_analytics_by_jurisdiction_geo_api = case_count_analytics_by_jurisdiction_geo_api - self.case_count_analytics_by_area_of_law_api = case_count_analytics_by_area_of_law_api - self.case_count_analytics_by_case_class_api = case_count_analytics_by_case_class_api - self.case_count_analytics_by_case_type_api = case_count_analytics_by_case_type_api - self.case_count_analytics_by_case_type_group_api = case_count_analytics_by_case_type_group_api - self.case_count_analytics_by_party_role_api = case_count_analytics_by_party_role_api - self.case_count_analytics_by_party_role_group_api = case_count_analytics_by_party_role_group_api - self.total_cases = total_cases - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_cause_of_action.py b/unicourt/model/case_cause_of_action.py index ed5b862..86d2852 100644 --- a/unicourt/model/case_cause_of_action.py +++ b/unicourt/model/case_cause_of_action.py @@ -1,295 +1,104 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.cause_of_action import CauseOfAction - from unicourt.model.cause_of_action_additional_data import CauseOfActionAdditionalData - globals()['CauseOfAction'] = CauseOfAction - globals()['CauseOfActionAdditionalData'] = CauseOfActionAdditionalData - - -class CaseCauseOfAction(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 17, - 'min_length': 17, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'cause_of_action': (CauseOfAction,), # noqa: E501 - 'cause_of_action_additional_data_array': ([CauseOfActionAdditionalData],), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.cause_of_action import CauseOfAction +from unicourt.model.cause_of_action_additional_data import CauseOfActionAdditionalData +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class CaseCauseOfAction(BaseModel): + """ + CaseCauseOfAction + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=17)]] = Field(default='CaseCauseOfAction', description="Name of the object") + cause_of_action: Optional[CauseOfAction] = Field(default=None, alias="causeOfAction") + cause_of_action_additional_data_array: Optional[List[CauseOfActionAdditionalData]] = Field(default=None, alias="causeOfActionAdditionalDataArray") + __properties: ClassVar[List[str]] = ["object", "causeOfAction", "causeOfActionAdditionalDataArray"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'object': 'object', # noqa: E501 - 'cause_of_action': 'causeOfAction', # noqa: E501 - 'cause_of_action_additional_data_array': 'causeOfActionAdditionalDataArray', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, cause_of_action, cause_of_action_additional_data_array, *args, **kwargs): # noqa: E501 - """CaseCauseOfAction - a model defined in OpenAPI - - Args: - cause_of_action (CauseOfAction): - cause_of_action_additional_data_array ([CauseOfActionAdditionalData]): - - Keyword Args: - object (str): Name of the object. defaults to "CaseCauseOfAction" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCauseOfAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "CaseCauseOfAction") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.cause_of_action = cause_of_action - self.cause_of_action_additional_data_array = cause_of_action_additional_data_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, cause_of_action, cause_of_action_additional_data_array, *args, **kwargs): # noqa: E501 - """CaseCauseOfAction - a model defined in OpenAPI - - Args: - cause_of_action (CauseOfAction): - cause_of_action_additional_data_array ([CauseOfActionAdditionalData]): - - Keyword Args: - object (str): Name of the object. defaults to "CaseCauseOfAction" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of cause_of_action + if self.cause_of_action: + _dict['causeOfAction'] = self.cause_of_action.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in cause_of_action_additional_data_array (list) + _items = [] + if self.cause_of_action_additional_data_array: + for _item in self.cause_of_action_additional_data_array: + if _item: + _items.append(_item.to_dict()) + _dict['causeOfActionAdditionalDataArray'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCauseOfAction from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCauseOfAction") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCauseOfAction', + "causeOfAction": CauseOfAction.from_dict(obj["causeOfAction"]) if obj.get("causeOfAction") is not None else None, + "causeOfActionAdditionalDataArray": [CauseOfActionAdditionalData.from_dict(_item) for _item in obj["causeOfActionAdditionalDataArray"]] if obj.get("causeOfActionAdditionalDataArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.cause_of_action = cause_of_action - self.cause_of_action_additional_data_array = cause_of_action_additional_data_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_charge.py b/unicourt/model/case_charge.py index f951e00..9c06c29 100644 --- a/unicourt/model/case_charge.py +++ b/unicourt/model/case_charge.py @@ -1,311 +1,116 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.charge import Charge - from unicourt.model.charge_additional_data import ChargeAdditionalData - from unicourt.model.charge_degree import ChargeDegree - from unicourt.model.charge_severity import ChargeSeverity - globals()['Charge'] = Charge - globals()['ChargeAdditionalData'] = ChargeAdditionalData - globals()['ChargeDegree'] = ChargeDegree - globals()['ChargeSeverity'] = ChargeSeverity - - -class CaseCharge(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - validations = { - ('object',): { - 'max_length': 10, - 'min_length': 10, - }, - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.charge import Charge +from unicourt.model.charge_additional_data import ChargeAdditionalData +from unicourt.model.charge_degree import ChargeDegree +from unicourt.model.charge_severity import ChargeSeverity +from typing import Optional, Set +from typing_extensions import Self + +class CaseCharge(BaseModel): + """ + CaseCharge + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=10, strict=True, max_length=10)]] = Field(default='CaseCharge', description="Name of the object") + charge: Optional[Charge] = None + charge_degree: Optional[ChargeDegree] = Field(default=None, alias="chargeDegree") + charge_severity: Optional[ChargeSeverity] = Field(default=None, alias="chargeSeverity") + charge_additional_data_array: Optional[List[ChargeAdditionalData]] = Field(default=None, alias="chargeAdditionalDataArray") + __properties: ClassVar[List[str]] = ["object", "charge", "chargeDegree", "chargeSeverity", "chargeAdditionalDataArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCharge from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'charge': (Charge,), # noqa: E501 - 'charge_degree': (ChargeDegree,), # noqa: E501 - 'charge_severity': (ChargeSeverity,), # noqa: E501 - 'charge_additional_data_array': ([ChargeAdditionalData],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'charge': 'charge', # noqa: E501 - 'charge_degree': 'chargeDegree', # noqa: E501 - 'charge_severity': 'chargeSeverity', # noqa: E501 - 'charge_additional_data_array': 'chargeAdditionalDataArray', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of charge + if self.charge: + _dict['charge'] = self.charge.to_dict() + # override the default output from pydantic by calling `to_dict()` of charge_degree + if self.charge_degree: + _dict['chargeDegree'] = self.charge_degree.to_dict() + # override the default output from pydantic by calling `to_dict()` of charge_severity + if self.charge_severity: + _dict['chargeSeverity'] = self.charge_severity.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in charge_additional_data_array (list) + _items = [] + if self.charge_additional_data_array: + for _item in self.charge_additional_data_array: + if _item: + _items.append(_item.to_dict()) + _dict['chargeAdditionalDataArray'] = _items + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, charge, charge_degree, charge_severity, charge_additional_data_array, *args, **kwargs): # noqa: E501 - """CaseCharge - a model defined in OpenAPI - - Args: - charge (Charge): - charge_degree (ChargeDegree): - charge_severity (ChargeSeverity): - charge_additional_data_array ([ChargeAdditionalData]): - - Keyword Args: - object (str): Name of the object. defaults to "CaseCharge" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCharge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.charge = charge - self.charge_degree = charge_degree - self.charge_severity = charge_severity - self.charge_additional_data_array = charge_additional_data_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, charge, charge_degree, charge_severity, charge_additional_data_array, *args, **kwargs): # noqa: E501 - """CaseCharge - a model defined in OpenAPI - - Args: - charge (Charge): - charge_degree (ChargeDegree): - charge_severity (ChargeSeverity): - charge_additional_data_array ([ChargeAdditionalData]): - - Keyword Args: - object (str): Name of the object. defaults to "CaseCharge" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCharge from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCharge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCharge', + "charge": Charge.from_dict(obj["charge"]) if obj.get("charge") is not None else None, + "chargeDegree": ChargeDegree.from_dict(obj["chargeDegree"]) if obj.get("chargeDegree") is not None else None, + "chargeSeverity": ChargeSeverity.from_dict(obj["chargeSeverity"]) if obj.get("chargeSeverity") is not None else None, + "chargeAdditionalDataArray": [ChargeAdditionalData.from_dict(_item) for _item in obj["chargeAdditionalDataArray"]] if obj.get("chargeAdditionalDataArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.charge = charge - self.charge_degree = charge_degree - self.charge_severity = charge_severity - self.charge_additional_data_array = charge_additional_data_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_class.py b/unicourt/model/case_class.py index 0f63e45..575a6c0 100644 --- a/unicourt/model/case_class.py +++ b/unicourt/model/case_class.py @@ -1,305 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CaseClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseClass(BaseModel): """ + CaseClass + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]] = 'CaseClass' + case_class_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="caseClassId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "caseClassId", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 9, - 'min_length': 9, - }, - ('case_class_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseClass from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'case_class_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_class_id': 'caseClassId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_class_id, name, created_date, *args, **kwargs): # noqa: E501 - """CaseClass - a model defined in OpenAPI - - Args: - case_class_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CaseClass" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseClass") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_class_id = case_class_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_class_id, name, created_date, *args, **kwargs): # noqa: E501 - """CaseClass - a model defined in OpenAPI - - Args: - case_class_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CaseClass" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseClass from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseClass") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseClass', + "caseClassId": obj.get("caseClassId"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_class_id = case_class_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_class_coverage.py b/unicourt/model/case_class_coverage.py index b8a450d..7707143 100644 --- a/unicourt/model/case_class_coverage.py +++ b/unicourt/model/case_class_coverage.py @@ -1,345 +1,112 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_class import CaseClass - globals()['CaseClass'] = CaseClass - - -class CaseClassCoverage(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 17, - 'min_length': 17, - }, - ('court_service_status_api',): { - 'max_length': 250, - 'min_length': 50, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_class': (CaseClass,), # noqa: E501 - 'court_service_status_api': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'cases_in_last_thirty_days_count': (int,), # noqa: E501 - 'free_case_document_count': (int,), # noqa: E501 - 'free_case_documents_in_last_thirty_days_count': (int,), # noqa: E501 - 'paid_case_document_count': (int,), # noqa: E501 - 'paid_case_documents_in_last_thirty_days_count': (int,), # noqa: E501 - 'case_document_in_library_count': (int,), # noqa: E501 - 'case_document_in_library_in_last_thirty_days_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_class': 'caseClass', # noqa: E501 - 'court_service_status_api': 'courtServiceStatusAPI', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'cases_in_last_thirty_days_count': 'casesInLastThirtyDaysCount', # noqa: E501 - 'free_case_document_count': 'freeCaseDocumentCount', # noqa: E501 - 'free_case_documents_in_last_thirty_days_count': 'freeCaseDocumentsInLastThirtyDaysCount', # noqa: E501 - 'paid_case_document_count': 'paidCaseDocumentCount', # noqa: E501 - 'paid_case_documents_in_last_thirty_days_count': 'paidCaseDocumentsInLastThirtyDaysCount', # noqa: E501 - 'case_document_in_library_count': 'caseDocumentInLibraryCount', # noqa: E501 - 'case_document_in_library_in_last_thirty_days_count': 'caseDocumentInLibraryInLastThirtyDaysCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_class import CaseClass +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseClassCoverage(BaseModel): + """ + CaseClassCoverage + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=17)]] = Field(default='CaseClassCoverage', description="Name of the object") + case_class: Optional[CaseClass] = Field(default=None, alias="caseClass") + court_service_status_api: Optional[Annotated[str, Field(min_length=50, strict=True, max_length=250)]] = Field(default=None, description="API Link to the Court Service status with filters of court and case class", alias="courtServiceStatusAPI") + case_count: Optional[StrictInt] = Field(default=None, description="Total Cases for a specific CourtLocation.", alias="caseCount") + cases_in_last_thirty_days_count: Optional[StrictInt] = Field(default=None, description="Cases in last 30 days that were added to UniCourt for a specific CourtLocation", alias="casesInLastThirtyDaysCount") + free_case_document_count: Optional[StrictInt] = Field(default=None, description="Free Case Documents for a specific CourtLocation.", alias="freeCaseDocumentCount") + free_case_documents_in_last_thirty_days_count: Optional[StrictInt] = Field(default=None, description="Free Case Documents in last 30 days that were added to UniCourt for a specific CourtLocation.", alias="freeCaseDocumentsInLastThirtyDaysCount") + paid_case_document_count: Optional[StrictInt] = Field(default=None, description="Paid Case Documents for a specific CourtLocation.", alias="paidCaseDocumentCount") + paid_case_documents_in_last_thirty_days_count: Optional[StrictInt] = Field(default=None, description="Paid Case Documents in last 30 days that were added to UniCourt for a specific CourtLocation.", alias="paidCaseDocumentsInLastThirtyDaysCount") + case_document_in_library_count: Optional[StrictInt] = Field(default=None, description="Case Documents that were added to UniCourt Crowd Source Library for a specific CourtLocationy.", alias="caseDocumentInLibraryCount") + case_document_in_library_in_last_thirty_days_count: Optional[StrictInt] = Field(default=None, description="Case Documents that were added to UniCourt Crowd Source Library for a specific CourtLocation in last 30 days.", alias="caseDocumentInLibraryInLastThirtyDaysCount") + __properties: ClassVar[List[str]] = ["object", "caseClass", "courtServiceStatusAPI", "caseCount", "casesInLastThirtyDaysCount", "freeCaseDocumentCount", "freeCaseDocumentsInLastThirtyDaysCount", "paidCaseDocumentCount", "paidCaseDocumentsInLastThirtyDaysCount", "caseDocumentInLibraryCount", "caseDocumentInLibraryInLastThirtyDaysCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_class, court_service_status_api, case_count, cases_in_last_thirty_days_count, free_case_document_count, free_case_documents_in_last_thirty_days_count, paid_case_document_count, paid_case_documents_in_last_thirty_days_count, case_document_in_library_count, case_document_in_library_in_last_thirty_days_count, *args, **kwargs): # noqa: E501 - """CaseClassCoverage - a model defined in OpenAPI - - Args: - case_class (CaseClass): - court_service_status_api (str): API Link to the Court Service status with filters of court and case class - case_count (int): Total Cases for a specific CourtLocation. - cases_in_last_thirty_days_count (int): Cases in last 30 days that were added to UniCourt for a specific CourtLocation - free_case_document_count (int): Free Case Documents for a specific CourtLocation. - free_case_documents_in_last_thirty_days_count (int): Free Case Documents in last 30 days that were added to UniCourt for a specific CourtLocation. - paid_case_document_count (int): Paid Case Documents for a specific CourtLocation. - paid_case_documents_in_last_thirty_days_count (int): Paid Case Documents in last 30 days that were added to UniCourt for a specific CourtLocation. - case_document_in_library_count (int): Case Documents that were added to UniCourt Crowd Source Library for a specific CourtLocationy. - case_document_in_library_in_last_thirty_days_count (int): Case Documents that were added to UniCourt Crowd Source Library for a specific CourtLocation in last 30 days. - - Keyword Args: - object (str): Name of the object. defaults to "CaseClassCoverage" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseClassCoverage") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseClassCoverage from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.case_class = case_class - self.court_service_status_api = court_service_status_api - self.case_count = case_count - self.cases_in_last_thirty_days_count = cases_in_last_thirty_days_count - self.free_case_document_count = free_case_document_count - self.free_case_documents_in_last_thirty_days_count = free_case_documents_in_last_thirty_days_count - self.paid_case_document_count = paid_case_document_count - self.paid_case_documents_in_last_thirty_days_count = paid_case_documents_in_last_thirty_days_count - self.case_document_in_library_count = case_document_in_library_count - self.case_document_in_library_in_last_thirty_days_count = case_document_in_library_in_last_thirty_days_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, case_class, court_service_status_api, case_count, cases_in_last_thirty_days_count, free_case_document_count, free_case_documents_in_last_thirty_days_count, paid_case_document_count, paid_case_documents_in_last_thirty_days_count, case_document_in_library_count, case_document_in_library_in_last_thirty_days_count, *args, **kwargs): # noqa: E501 - """CaseClassCoverage - a model defined in OpenAPI - - Args: - case_class (CaseClass): - court_service_status_api (str): API Link to the Court Service status with filters of court and case class - case_count (int): Total Cases for a specific CourtLocation. - cases_in_last_thirty_days_count (int): Cases in last 30 days that were added to UniCourt for a specific CourtLocation - free_case_document_count (int): Free Case Documents for a specific CourtLocation. - free_case_documents_in_last_thirty_days_count (int): Free Case Documents in last 30 days that were added to UniCourt for a specific CourtLocation. - paid_case_document_count (int): Paid Case Documents for a specific CourtLocation. - paid_case_documents_in_last_thirty_days_count (int): Paid Case Documents in last 30 days that were added to UniCourt for a specific CourtLocation. - case_document_in_library_count (int): Case Documents that were added to UniCourt Crowd Source Library for a specific CourtLocationy. - case_document_in_library_in_last_thirty_days_count (int): Case Documents that were added to UniCourt Crowd Source Library for a specific CourtLocation in last 30 days. - - Keyword Args: - object (str): Name of the object. defaults to "CaseClassCoverage" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_class + if self.case_class: + _dict['caseClass'] = self.case_class.to_dict() + return _dict - object = kwargs.get('object', "CaseClassCoverage") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseClassCoverage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseClassCoverage', + "caseClass": CaseClass.from_dict(obj["caseClass"]) if obj.get("caseClass") is not None else None, + "courtServiceStatusAPI": obj.get("courtServiceStatusAPI"), + "caseCount": obj.get("caseCount"), + "casesInLastThirtyDaysCount": obj.get("casesInLastThirtyDaysCount"), + "freeCaseDocumentCount": obj.get("freeCaseDocumentCount"), + "freeCaseDocumentsInLastThirtyDaysCount": obj.get("freeCaseDocumentsInLastThirtyDaysCount"), + "paidCaseDocumentCount": obj.get("paidCaseDocumentCount"), + "paidCaseDocumentsInLastThirtyDaysCount": obj.get("paidCaseDocumentsInLastThirtyDaysCount"), + "caseDocumentInLibraryCount": obj.get("caseDocumentInLibraryCount"), + "caseDocumentInLibraryInLastThirtyDaysCount": obj.get("caseDocumentInLibraryInLastThirtyDaysCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_class = case_class - self.court_service_status_api = court_service_status_api - self.case_count = case_count - self.cases_in_last_thirty_days_count = cases_in_last_thirty_days_count - self.free_case_document_count = free_case_document_count - self.free_case_documents_in_last_thirty_days_count = free_case_documents_in_last_thirty_days_count - self.paid_case_document_count = paid_case_document_count - self.paid_case_documents_in_last_thirty_days_count = paid_case_documents_in_last_thirty_days_count - self.case_document_in_library_count = case_document_in_library_count - self.case_document_in_library_in_last_thirty_days_count = case_document_in_library_in_last_thirty_days_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_class_response.py b/unicourt/model/case_class_response.py index e52ef0a..5ffc40b 100644 --- a/unicourt/model/case_class_response.py +++ b/unicourt/model/case_class_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_class import CaseClass - globals()['CaseClass'] = CaseClass - - -class CaseClassResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 17, - 'min_length': 17, - }, - ('case_class_array',): { - }, - ('next_page_api',): { - 'max_length': 2140, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2140, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_class_array': ([CaseClass],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_class_array': 'caseClassArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_class import CaseClass +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseClassResponse(BaseModel): + """ + CaseClassResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=17)]] = 'CaseClassResponse' + case_class_array: Optional[List[CaseClass]] = Field(default=None, alias="caseClassArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2140)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2140)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "caseClassArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_class_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseClassResponse - a model defined in OpenAPI - - Args: - case_class_array ([CaseClass]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CaseClassResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseClassResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseClassResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.case_class_array = case_class_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, case_class_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseClassResponse - a model defined in OpenAPI - - Args: - case_class_array ([CaseClass]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CaseClassResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in case_class_array (list) + _items = [] + if self.case_class_array: + for _item in self.case_class_array: + if _item: + _items.append(_item.to_dict()) + _dict['caseClassArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseClassResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseClassResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseClassResponse', + "caseClassArray": [CaseClass.from_dict(_item) for _item in obj["caseClassArray"]] if obj.get("caseClassArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_class_array = case_class_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_area_of_law.py b/unicourt/model/case_count_analytics_by_area_of_law.py index 54bb915..e7e7c6e 100644 --- a/unicourt/model/case_count_analytics_by_area_of_law.py +++ b/unicourt/model/case_count_analytics_by_area_of_law.py @@ -1,301 +1,98 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.area_of_law import AreaOfLaw - globals()['AreaOfLaw'] = AreaOfLaw +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class CaseCountAnalyticsByAreaOfLaw(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.area_of_law import AreaOfLaw +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByAreaOfLaw(BaseModel): """ + CaseCountAnalyticsByAreaOfLaw + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=29)]] = 'CaseCountAnalyticsByAreaOfLaw' + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to cases for this criteria.", alias="caseSearchAPI") + area_of_law: Optional[AreaOfLaw] = Field(default=None, alias="areaOfLaw") + __properties: ClassVar[List[str]] = ["object", "caseCount", "caseSearchAPI", "areaOfLaw"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 29, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByAreaOfLaw from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'area_of_law': (AreaOfLaw,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'area_of_law': 'areaOfLaw', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of area_of_law + if self.area_of_law: + _dict['areaOfLaw'] = self.area_of_law.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_count, case_search_api, area_of_law, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByAreaOfLaw - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): Link to cases for this criteria. - area_of_law (AreaOfLaw): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByAreaOfLaw" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByAreaOfLaw") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.area_of_law = area_of_law - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_count, case_search_api, area_of_law, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByAreaOfLaw - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): Link to cases for this criteria. - area_of_law (AreaOfLaw): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByAreaOfLaw" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByAreaOfLaw from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByAreaOfLaw") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByAreaOfLaw', + "caseCount": obj.get("caseCount"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "areaOfLaw": AreaOfLaw.from_dict(obj["areaOfLaw"]) if obj.get("areaOfLaw") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.area_of_law = area_of_law - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_area_of_law_response.py b/unicourt/model/case_count_analytics_by_area_of_law_response.py index 9f74500..9a0d801 100644 --- a/unicourt/model/case_count_analytics_by_area_of_law_response.py +++ b/unicourt/model/case_count_analytics_by_area_of_law_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_area_of_law import CaseCountAnalyticsByAreaOfLaw - globals()['CaseCountAnalyticsByAreaOfLaw'] = CaseCountAnalyticsByAreaOfLaw - - -class CaseCountAnalyticsByAreaOfLawResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 37, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'results': ([CaseCountAnalyticsByAreaOfLaw],), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_area_of_law_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'results': 'results', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_area_of_law_count': 'totalAreaOfLawCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_area_of_law import CaseCountAnalyticsByAreaOfLaw +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByAreaOfLawResponse(BaseModel): + """ + Case Counts by Area Of Law Response. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=37)]] = 'CaseCountAnalyticsByAreaOfLawResponse' + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + results: Optional[List[CaseCountAnalyticsByAreaOfLaw]] = None + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_area_of_law_count: Optional[StrictInt] = Field(default=None, description="Total no. of Area Of Law for this criteria.", alias="totalAreaOfLawCount") + __properties: ClassVar[List[str]] = ["object", "nextPageAPI", "previousPageAPI", "results", "totalPages", "totalCaseCount", "totalAreaOfLawCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, next_page_api, previous_page_api, results, total_pages, total_case_count, total_area_of_law_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByAreaOfLawResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByAreaOfLaw]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_area_of_law_count (int): Total no. of Area Of Law for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByAreaOfLawResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByAreaOfLawResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByAreaOfLawResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_area_of_law_count = total_area_of_law_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, next_page_api, previous_page_api, results, total_pages, total_case_count, total_area_of_law_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByAreaOfLawResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByAreaOfLaw]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_area_of_law_count (int): Total no. of Area Of Law for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByAreaOfLawResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByAreaOfLawResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByAreaOfLawResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByAreaOfLawResponse', + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "results": [CaseCountAnalyticsByAreaOfLaw.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalAreaOfLawCount": obj.get("totalAreaOfLawCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_area_of_law_count = total_area_of_law_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_case_class.py b/unicourt/model/case_count_analytics_by_case_class.py index 1f2191c..925323a 100644 --- a/unicourt/model/case_count_analytics_by_case_class.py +++ b/unicourt/model/case_count_analytics_by_case_class.py @@ -1,301 +1,98 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.case_class import CaseClass - globals()['CaseClass'] = CaseClass +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class CaseCountAnalyticsByCaseClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_class import CaseClass +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByCaseClass(BaseModel): """ + CaseCountAnalyticsByCaseClass + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=29)]] = 'CaseCountAnalyticsByCaseClass' + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to cases for this criteria.", alias="caseSearchAPI") + case_class: Optional[CaseClass] = Field(default=None, alias="caseClass") + __properties: ClassVar[List[str]] = ["object", "caseCount", "caseSearchAPI", "caseClass"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 29, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseClass from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'case_class': (CaseClass,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_class': 'caseClass', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_class + if self.case_class: + _dict['caseClass'] = self.case_class.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_count, case_search_api, case_class, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseClass - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): Link to cases for this criteria. - case_class (CaseClass): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseClass" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCaseClass") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.case_class = case_class - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_count, case_search_api, case_class, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseClass - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): Link to cases for this criteria. - case_class (CaseClass): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseClass" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseClass from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByCaseClass") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCaseClass', + "caseCount": obj.get("caseCount"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseClass": CaseClass.from_dict(obj["caseClass"]) if obj.get("caseClass") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.case_class = case_class - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_case_class_response.py b/unicourt/model/case_count_analytics_by_case_class_response.py index 8738579..a2e68ab 100644 --- a/unicourt/model/case_count_analytics_by_case_class_response.py +++ b/unicourt/model/case_count_analytics_by_case_class_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_case_class import CaseCountAnalyticsByCaseClass - globals()['CaseCountAnalyticsByCaseClass'] = CaseCountAnalyticsByCaseClass - - -class CaseCountAnalyticsByCaseClassResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 37, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'results': ([CaseCountAnalyticsByCaseClass],), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_case_class_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'results': 'results', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_case_class_count': 'totalCaseClassCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_case_class import CaseCountAnalyticsByCaseClass +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByCaseClassResponse(BaseModel): + """ + Case Counts by Case Class Response. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=37)]] = 'CaseCountAnalyticsByCaseClassResponse' + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + results: Optional[List[CaseCountAnalyticsByCaseClass]] = None + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_case_class_count: Optional[StrictInt] = Field(default=None, description="Total no. of Case Class for this criteria.", alias="totalCaseClassCount") + __properties: ClassVar[List[str]] = ["object", "nextPageAPI", "previousPageAPI", "results", "totalPages", "totalCaseCount", "totalCaseClassCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, next_page_api, previous_page_api, results, total_pages, total_case_count, total_case_class_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseClassResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCaseClass]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_case_class_count (int): Total no. of Case Class for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseClassResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCaseClassResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseClassResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_case_class_count = total_case_class_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, next_page_api, previous_page_api, results, total_pages, total_case_count, total_case_class_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseClassResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCaseClass]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_case_class_count (int): Total no. of Case Class for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseClassResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByCaseClassResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseClassResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCaseClassResponse', + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "results": [CaseCountAnalyticsByCaseClass.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalCaseClassCount": obj.get("totalCaseClassCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_case_class_count = total_case_class_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_case_filed_date.py b/unicourt/model/case_count_analytics_by_case_filed_date.py index bb436c8..9576806 100644 --- a/unicourt/model/case_count_analytics_by_case_filed_date.py +++ b/unicourt/model/case_count_analytics_by_case_filed_date.py @@ -1,372 +1,161 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations +import pprint import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class CaseCountAnalyticsByCaseFiledDate(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByCaseFiledDate(BaseModel): """ + CaseCountAnalyticsByCaseFiledDate + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=33)]] = 'CaseCountAnalyticsByCaseFiledDate' + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to cases for this criteria.", alias="caseSearchAPI") + grouped_by: Optional[Annotated[str, Field(strict=True, max_length=9)]] = Field(default='Yearly', alias="groupedBy") + year: Optional[StrictInt] = None + quarter: Optional[Annotated[str, Field(strict=True, max_length=4)]] = None + month_string: Optional[Annotated[str, Field(strict=True, max_length=9)]] = Field(default=None, alias="monthString") + month_int: Optional[StrictInt] = Field(default=None, alias="monthInt") + week_of_year: Optional[StrictInt] = Field(default=None, alias="weekOfYear") + week_of_month: Optional[StrictInt] = Field(default=None, alias="weekOfMonth") + __properties: ClassVar[List[str]] = ["object", "caseCount", "caseSearchAPI", "groupedBy", "year", "quarter", "monthString", "monthInt", "weekOfYear", "weekOfMonth"] + + @field_validator('grouped_by') + def grouped_by_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Yearly', 'Quarterly', 'Monthly', 'Weekly']): + raise ValueError("must be one of enum values ('Yearly', 'Quarterly', 'Monthly', 'Weekly')") + return value + + @field_validator('quarter') + def quarter_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Q1', 'Q2', 'Q3', 'Q4', 'null']): + raise ValueError("must be one of enum values ('Q1', 'Q2', 'Q3', 'Q4', 'null')") + return value + + @field_validator('month_string') + def month_string_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', 'null']): + raise ValueError("must be one of enum values ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', 'null')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('grouped_by',): { - 'YEARLY': "Yearly", - 'QUARTERLY': "Quarterly", - 'MONTHLY': "Monthly", - 'WEEKLY': "Weekly", - }, - ('quarter',): { - 'None': None, - 'Q1': "Q1", - 'Q2': "Q2", - 'Q3': "Q3", - 'Q4': "Q4", - 'NULL': "null", - }, - ('month_string',): { - 'None': None, - 'JANUARY': "January", - 'FEBRUARY': "February", - 'MARCH': "March", - 'APRIL': "April", - 'MAY': "May", - 'JUNE': "June", - 'JULY': "July", - 'AUGUST': "August", - 'SEPTEMBER': "September", - 'OCTOBER': "October", - 'NOVEMBER': "November", - 'DECEMBER': "December", - 'NULL': "null", - }, - } - - validations = { - ('object',): { - 'max_length': 33, - }, - ('case_search_api',): { - 'max_length': 255, - }, - ('grouped_by',): { - 'max_length': 9, - }, - ('quarter',): { - 'max_length': 4, - }, - ('month_string',): { - 'max_length': 9, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseFiledDate from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'grouped_by': (str,), # noqa: E501 - 'year': (int,), # noqa: E501 - 'quarter': (str, none_type,), # noqa: E501 - 'month_string': (str, none_type,), # noqa: E501 - 'month_int': (int, none_type,), # noqa: E501 - 'week_of_year': (int, none_type,), # noqa: E501 - 'week_of_month': (int, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'grouped_by': 'groupedBy', # noqa: E501 - 'year': 'year', # noqa: E501 - 'quarter': 'quarter', # noqa: E501 - 'month_string': 'monthString', # noqa: E501 - 'month_int': 'monthInt', # noqa: E501 - 'week_of_year': 'weekOfYear', # noqa: E501 - 'week_of_month': 'weekOfMonth', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if quarter (nullable) is None + # and model_fields_set contains the field + if self.quarter is None and "quarter" in self.model_fields_set: + _dict['quarter'] = None + + # set to None if month_string (nullable) is None + # and model_fields_set contains the field + if self.month_string is None and "month_string" in self.model_fields_set: + _dict['monthString'] = None + + # set to None if month_int (nullable) is None + # and model_fields_set contains the field + if self.month_int is None and "month_int" in self.model_fields_set: + _dict['monthInt'] = None + + # set to None if week_of_year (nullable) is None + # and model_fields_set contains the field + if self.week_of_year is None and "week_of_year" in self.model_fields_set: + _dict['weekOfYear'] = None + + # set to None if week_of_month (nullable) is None + # and model_fields_set contains the field + if self.week_of_month is None and "week_of_month" in self.model_fields_set: + _dict['weekOfMonth'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_count, case_search_api, year, quarter, month_string, month_int, week_of_year, week_of_month, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseFiledDate - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): Link to cases for this criteria. - year (int): - quarter (str, none_type): - month_string (str, none_type): - month_int (int, none_type): - week_of_year (int, none_type): - week_of_month (int, none_type): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseFiledDate" # noqa: E501 - grouped_by (str): defaults to "Yearly", must be one of ["Yearly", "Quarterly", "Monthly", "Weekly", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseFiledDate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCaseFiledDate', + "caseCount": obj.get("caseCount"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "groupedBy": obj.get("groupedBy") if obj.get("groupedBy") is not None else 'Yearly', + "year": obj.get("year"), + "quarter": obj.get("quarter"), + "monthString": obj.get("monthString"), + "monthInt": obj.get("monthInt"), + "weekOfYear": obj.get("weekOfYear"), + "weekOfMonth": obj.get("weekOfMonth") + }) + return _obj - object = kwargs.get('object', "CaseCountAnalyticsByCaseFiledDate") - grouped_by = kwargs.get('grouped_by', "Yearly") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.grouped_by = grouped_by - self.year = year - self.quarter = quarter - self.month_string = month_string - self.month_int = month_int - self.week_of_year = week_of_year - self.week_of_month = week_of_month - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_count, case_search_api, year, quarter, month_string, month_int, week_of_year, week_of_month, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseFiledDate - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): Link to cases for this criteria. - year (int): - quarter (str, none_type): - month_string (str, none_type): - month_int (int, none_type): - week_of_year (int, none_type): - week_of_month (int, none_type): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseFiledDate" # noqa: E501 - grouped_by (str): defaults to "Yearly", must be one of ["Yearly", "Quarterly", "Monthly", "Weekly", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - object = kwargs.get('object', "CaseCountAnalyticsByCaseFiledDate") - grouped_by = kwargs.get('grouped_by', "Yearly") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.grouped_by = grouped_by - self.year = year - self.quarter = quarter - self.month_string = month_string - self.month_int = month_int - self.week_of_year = week_of_year - self.week_of_month = week_of_month - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_case_filed_date_response.py b/unicourt/model/case_count_analytics_by_case_filed_date_response.py index 66ab3b1..24c9c38 100644 --- a/unicourt/model/case_count_analytics_by_case_filed_date_response.py +++ b/unicourt/model/case_count_analytics_by_case_filed_date_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_case_filed_date import CaseCountAnalyticsByCaseFiledDate - globals()['CaseCountAnalyticsByCaseFiledDate'] = CaseCountAnalyticsByCaseFiledDate - - -class CaseCountAnalyticsByCaseFiledDateResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 41, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'results': ([CaseCountAnalyticsByCaseFiledDate],), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_case_filed_date_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'results': 'results', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_case_filed_date_count': 'totalCaseFiledDateCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_case_filed_date import CaseCountAnalyticsByCaseFiledDate +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByCaseFiledDateResponse(BaseModel): + """ + Response for Case Count by filing date. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=41)]] = 'CaseCountAnalyticsByCaseFiledDateResponse' + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + results: Optional[List[CaseCountAnalyticsByCaseFiledDate]] = None + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_case_filed_date_count: Optional[StrictInt] = Field(default=None, description="Total no. of Case File Date for this criteria.", alias="totalCaseFiledDateCount") + __properties: ClassVar[List[str]] = ["object", "nextPageAPI", "previousPageAPI", "results", "totalPages", "totalCaseCount", "totalCaseFiledDateCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, next_page_api, previous_page_api, results, total_pages, total_case_count, total_case_filed_date_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseFiledDateResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCaseFiledDate]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_case_filed_date_count (int): Total no. of Case File Date for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseFiledDateResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCaseFiledDateResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseFiledDateResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_case_filed_date_count = total_case_filed_date_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, next_page_api, previous_page_api, results, total_pages, total_case_count, total_case_filed_date_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseFiledDateResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCaseFiledDate]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_case_filed_date_count (int): Total no. of Case File Date for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseFiledDateResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByCaseFiledDateResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseFiledDateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCaseFiledDateResponse', + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "results": [CaseCountAnalyticsByCaseFiledDate.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalCaseFiledDateCount": obj.get("totalCaseFiledDateCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_case_filed_date_count = total_case_filed_date_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_case_type.py b/unicourt/model/case_count_analytics_by_case_type.py index 7001ebc..655dc21 100644 --- a/unicourt/model/case_count_analytics_by_case_type.py +++ b/unicourt/model/case_count_analytics_by_case_type.py @@ -1,301 +1,98 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.case_type import CaseType - globals()['CaseType'] = CaseType +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class CaseCountAnalyticsByCaseType(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_type import CaseType +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByCaseType(BaseModel): """ + CaseCountAnalyticsByCaseType + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=28)]] = 'CaseCountAnalyticsByCaseType' + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to cases for this criteria.", alias="caseSearchAPI") + case_type: Optional[CaseType] = Field(default=None, alias="caseType") + __properties: ClassVar[List[str]] = ["object", "caseCount", "caseSearchAPI", "caseType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 28, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseType from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'case_type': (CaseType,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_type': 'caseType', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_type + if self.case_type: + _dict['caseType'] = self.case_type.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_count, case_search_api, case_type, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseType - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): Link to cases for this criteria. - case_type (CaseType): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCaseType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.case_type = case_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_count, case_search_api, case_type, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseType - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): Link to cases for this criteria. - case_type (CaseType): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseType from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByCaseType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCaseType', + "caseCount": obj.get("caseCount"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseType": CaseType.from_dict(obj["caseType"]) if obj.get("caseType") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.case_type = case_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_case_type_group.py b/unicourt/model/case_count_analytics_by_case_type_group.py index 718ad86..878f8dc 100644 --- a/unicourt/model/case_count_analytics_by_case_type_group.py +++ b/unicourt/model/case_count_analytics_by_case_type_group.py @@ -1,301 +1,98 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.case_type_group import CaseTypeGroup - globals()['CaseTypeGroup'] = CaseTypeGroup +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class CaseCountAnalyticsByCaseTypeGroup(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_type_group import CaseTypeGroup +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByCaseTypeGroup(BaseModel): """ + CaseCountAnalyticsByCaseTypeGroup + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=33)]] = 'CaseCountAnalyticsByCaseTypeGroup' + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to cases for this criteria.", alias="caseSearchAPI") + case_type_group: Optional[CaseTypeGroup] = Field(default=None, alias="caseTypeGroup") + __properties: ClassVar[List[str]] = ["object", "caseCount", "caseSearchAPI", "caseTypeGroup"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 33, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseTypeGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'case_type_group': (CaseTypeGroup,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_type_group': 'caseTypeGroup', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_type_group + if self.case_type_group: + _dict['caseTypeGroup'] = self.case_type_group.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_count, case_search_api, case_type_group, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseTypeGroup - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): Link to cases for this criteria. - case_type_group (CaseTypeGroup): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseTypeGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCaseTypeGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.case_type_group = case_type_group - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_count, case_search_api, case_type_group, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseTypeGroup - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): Link to cases for this criteria. - case_type_group (CaseTypeGroup): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseTypeGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseTypeGroup from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByCaseTypeGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCaseTypeGroup', + "caseCount": obj.get("caseCount"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseTypeGroup": CaseTypeGroup.from_dict(obj["caseTypeGroup"]) if obj.get("caseTypeGroup") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.case_type_group = case_type_group - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_case_type_group_response.py b/unicourt/model/case_count_analytics_by_case_type_group_response.py index b7a7ba8..4cf7caa 100644 --- a/unicourt/model/case_count_analytics_by_case_type_group_response.py +++ b/unicourt/model/case_count_analytics_by_case_type_group_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_case_type_group import CaseCountAnalyticsByCaseTypeGroup - globals()['CaseCountAnalyticsByCaseTypeGroup'] = CaseCountAnalyticsByCaseTypeGroup - - -class CaseCountAnalyticsByCaseTypeGroupResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 41, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'results': ([CaseCountAnalyticsByCaseTypeGroup],), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_case_type_group_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'results': 'results', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_case_type_group_count': 'totalCaseTypeGroupCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_case_type_group import CaseCountAnalyticsByCaseTypeGroup +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByCaseTypeGroupResponse(BaseModel): + """ + Case Counts by Case Type Group Response. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=41)]] = 'CaseCountAnalyticsByCaseTypeGroupResponse' + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + results: Optional[List[CaseCountAnalyticsByCaseTypeGroup]] = None + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_case_type_group_count: Optional[StrictInt] = Field(default=None, description="Total no. of Case Type Group for this criteria.", alias="totalCaseTypeGroupCount") + __properties: ClassVar[List[str]] = ["object", "nextPageAPI", "previousPageAPI", "results", "totalPages", "totalCaseCount", "totalCaseTypeGroupCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, next_page_api, previous_page_api, results, total_pages, total_case_count, total_case_type_group_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseTypeGroupResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCaseTypeGroup]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_case_type_group_count (int): Total no. of Case Type Group for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseTypeGroupResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCaseTypeGroupResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseTypeGroupResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_case_type_group_count = total_case_type_group_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, next_page_api, previous_page_api, results, total_pages, total_case_count, total_case_type_group_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseTypeGroupResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCaseTypeGroup]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_case_type_group_count (int): Total no. of Case Type Group for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseTypeGroupResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByCaseTypeGroupResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseTypeGroupResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCaseTypeGroupResponse', + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "results": [CaseCountAnalyticsByCaseTypeGroup.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalCaseTypeGroupCount": obj.get("totalCaseTypeGroupCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_case_type_group_count = total_case_type_group_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_case_type_response.py b/unicourt/model/case_count_analytics_by_case_type_response.py index e1e81ff..31c43cc 100644 --- a/unicourt/model/case_count_analytics_by_case_type_response.py +++ b/unicourt/model/case_count_analytics_by_case_type_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_case_type import CaseCountAnalyticsByCaseType - globals()['CaseCountAnalyticsByCaseType'] = CaseCountAnalyticsByCaseType - - -class CaseCountAnalyticsByCaseTypeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 36, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'results': ([CaseCountAnalyticsByCaseType],), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_case_type_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'results': 'results', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_case_type_count': 'totalCaseTypeCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_case_type import CaseCountAnalyticsByCaseType +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByCaseTypeResponse(BaseModel): + """ + Case Counts by Case Types Response. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=36)]] = 'CaseCountAnalyticsByCaseTypeResponse' + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + results: Optional[List[CaseCountAnalyticsByCaseType]] = None + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_case_type_count: Optional[StrictInt] = Field(default=None, description="Total no. of CaseType for this criteria.", alias="totalCaseTypeCount") + __properties: ClassVar[List[str]] = ["object", "nextPageAPI", "previousPageAPI", "results", "totalPages", "totalCaseCount", "totalCaseTypeCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, next_page_api, previous_page_api, results, total_pages, total_case_count, total_case_type_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseTypeResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCaseType]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_case_type_count (int): Total no. of CaseType for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCaseTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseTypeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_case_type_count = total_case_type_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, next_page_api, previous_page_api, results, total_pages, total_case_count, total_case_type_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCaseTypeResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCaseType]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_case_type_count (int): Total no. of CaseType for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCaseTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByCaseTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCaseTypeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCaseTypeResponse', + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "results": [CaseCountAnalyticsByCaseType.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalCaseTypeCount": obj.get("totalCaseTypeCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_case_type_count = total_case_type_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_court.py b/unicourt/model/case_count_analytics_by_court.py index 66864f5..43e2d71 100644 --- a/unicourt/model/case_count_analytics_by_court.py +++ b/unicourt/model/case_count_analytics_by_court.py @@ -1,309 +1,104 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.case_count_analytics_by_court_geo import CaseCountAnalyticsByCourtGeo - from unicourt.model.court import Court - globals()['CaseCountAnalyticsByCourtGeo'] = CaseCountAnalyticsByCourtGeo - globals()['Court'] = Court +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class CaseCountAnalyticsByCourt(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_court_geo import CaseCountAnalyticsByCourtGeo +from unicourt.model.court import Court +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByCourt(BaseModel): """ + CaseCountAnalyticsByCourt + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=25)]] = 'CaseCountAnalyticsByCourt' + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="link to cases for this criteria.", alias="caseSearchAPI") + court: Optional[Court] = None + geo: Optional[CaseCountAnalyticsByCourtGeo] = Field(default=None, alias="Geo") + __properties: ClassVar[List[str]] = ["object", "caseCount", "caseSearchAPI", "court", "Geo"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 25, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourt from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'court': (Court,), # noqa: E501 - 'geo': (CaseCountAnalyticsByCourtGeo,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'court': 'court', # noqa: E501 - 'geo': 'Geo', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of court + if self.court: + _dict['court'] = self.court.to_dict() + # override the default output from pydantic by calling `to_dict()` of geo + if self.geo: + _dict['Geo'] = self.geo.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_count, case_search_api, court, geo, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourt - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): link to cases for this criteria. - court (Court): - geo (CaseCountAnalyticsByCourtGeo): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourt" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCourt") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.court = court - self.geo = geo - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_count, case_search_api, court, geo, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourt - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): link to cases for this criteria. - court (Court): - geo (CaseCountAnalyticsByCourtGeo): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourt" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourt from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByCourt") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCourt', + "caseCount": obj.get("caseCount"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "court": Court.from_dict(obj["court"]) if obj.get("court") is not None else None, + "Geo": CaseCountAnalyticsByCourtGeo.from_dict(obj["Geo"]) if obj.get("Geo") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.court = court - self.geo = geo - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_court_geo.py b/unicourt/model/case_count_analytics_by_court_geo.py index 21f069c..dfdd45a 100644 --- a/unicourt/model/case_count_analytics_by_court_geo.py +++ b/unicourt/model/case_count_analytics_by_court_geo.py @@ -1,281 +1,100 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class CaseCountAnalyticsByCourtGeo(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('latitude',): { - 'max_length': 15, - }, - ('longitude',): { - 'max_length': 15, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'latitude': (str, none_type,), # noqa: E501 - 'longitude': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class CaseCountAnalyticsByCourtGeo(BaseModel): + """ + CaseCountAnalyticsByCourtGeo + """ # noqa: E501 + latitude: Optional[Annotated[str, Field(strict=True, max_length=15)]] = None + longitude: Optional[Annotated[str, Field(strict=True, max_length=15)]] = None + __properties: ClassVar[List[str]] = ["latitude", "longitude"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'latitude': 'latitude', # noqa: E501 - 'longitude': 'longitude', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, latitude, longitude, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtGeo - a model defined in OpenAPI - - Args: - latitude (str, none_type): - longitude (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtGeo from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.latitude = latitude - self.longitude = longitude - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, latitude, longitude, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtGeo - a model defined in OpenAPI - - Args: - latitude (str, none_type): - longitude (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if latitude (nullable) is None + # and model_fields_set contains the field + if self.latitude is None and "latitude" in self.model_fields_set: + _dict['latitude'] = None + + # set to None if longitude (nullable) is None + # and model_fields_set contains the field + if self.longitude is None and "longitude" in self.model_fields_set: + _dict['longitude'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtGeo from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "latitude": obj.get("latitude"), + "longitude": obj.get("longitude") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.latitude = latitude - self.longitude = longitude - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_court_location.py b/unicourt/model/case_count_analytics_by_court_location.py index be914e7..c3687a2 100644 --- a/unicourt/model/case_count_analytics_by_court_location.py +++ b/unicourt/model/case_count_analytics_by_court_location.py @@ -1,317 +1,110 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_court_geo import CaseCountAnalyticsByCourtGeo - from unicourt.model.court import Court - from unicourt.model.court_location import CourtLocation - globals()['CaseCountAnalyticsByCourtGeo'] = CaseCountAnalyticsByCourtGeo - globals()['Court'] = Court - globals()['CourtLocation'] = CourtLocation - - -class CaseCountAnalyticsByCourtLocation(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - validations = { - ('object',): { - 'max_length': 33, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_court_geo import CaseCountAnalyticsByCourtGeo +from unicourt.model.court import Court +from unicourt.model.court_location import CourtLocation +from typing import Optional, Set +from typing_extensions import Self + +class CaseCountAnalyticsByCourtLocation(BaseModel): + """ + CaseCountAnalyticsByCourtLocation + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=33)]] = 'CaseCountAnalyticsByCourtLocation' + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="link to cases for this criteria.", alias="caseSearchAPI") + court_location: Optional[CourtLocation] = Field(default=None, alias="courtLocation") + court: Optional[Court] = None + geo: Optional[CaseCountAnalyticsByCourtGeo] = Field(default=None, alias="Geo") + __properties: ClassVar[List[str]] = ["object", "caseCount", "caseSearchAPI", "courtLocation", "court", "Geo"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtLocation from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'court_location': (CourtLocation,), # noqa: E501 - 'court': (Court,), # noqa: E501 - 'geo': (CaseCountAnalyticsByCourtGeo,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'court_location': 'courtLocation', # noqa: E501 - 'court': 'court', # noqa: E501 - 'geo': 'Geo', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of court_location + if self.court_location: + _dict['courtLocation'] = self.court_location.to_dict() + # override the default output from pydantic by calling `to_dict()` of court + if self.court: + _dict['court'] = self.court.to_dict() + # override the default output from pydantic by calling `to_dict()` of geo + if self.geo: + _dict['Geo'] = self.geo.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_count, case_search_api, court_location, court, geo, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtLocation - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): link to cases for this criteria. - court_location (CourtLocation): - court (Court): - geo (CaseCountAnalyticsByCourtGeo): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourtLocation" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCourtLocation") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.court_location = court_location - self.court = court - self.geo = geo - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_count, case_search_api, court_location, court, geo, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtLocation - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): link to cases for this criteria. - court_location (CourtLocation): - court (Court): - geo (CaseCountAnalyticsByCourtGeo): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourtLocation" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtLocation from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByCourtLocation") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCourtLocation', + "caseCount": obj.get("caseCount"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "courtLocation": CourtLocation.from_dict(obj["courtLocation"]) if obj.get("courtLocation") is not None else None, + "court": Court.from_dict(obj["court"]) if obj.get("court") is not None else None, + "Geo": CaseCountAnalyticsByCourtGeo.from_dict(obj["Geo"]) if obj.get("Geo") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.court_location = court_location - self.court = court - self.geo = geo - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_court_location_response.py b/unicourt/model/case_count_analytics_by_court_location_response.py index e05fcc1..8e697e3 100644 --- a/unicourt/model/case_count_analytics_by_court_location_response.py +++ b/unicourt/model/case_count_analytics_by_court_location_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_court_location import CaseCountAnalyticsByCourtLocation - globals()['CaseCountAnalyticsByCourtLocation'] = CaseCountAnalyticsByCourtLocation - - -class CaseCountAnalyticsByCourtLocationResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 41, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'results': ([CaseCountAnalyticsByCourtLocation],), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_court_location_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'results': 'results', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_court_location_count': 'totalCourtLocationCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_court_location import CaseCountAnalyticsByCourtLocation +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByCourtLocationResponse(BaseModel): + """ + Case Counts by Court Location Response. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=41)]] = 'CaseCountAnalyticsByCourtLocationResponse' + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + results: Optional[List[CaseCountAnalyticsByCourtLocation]] = None + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_court_location_count: Optional[StrictInt] = Field(default=None, description="Total no. of Court Location for this criteria.", alias="totalCourtLocationCount") + __properties: ClassVar[List[str]] = ["object", "nextPageAPI", "previousPageAPI", "results", "totalPages", "totalCaseCount", "totalCourtLocationCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, next_page_api, previous_page_api, results, total_pages, total_case_count, total_court_location_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtLocationResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCourtLocation]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_court_location_count (int): Total no. of Court Location for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourtLocationResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCourtLocationResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtLocationResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_court_location_count = total_court_location_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, next_page_api, previous_page_api, results, total_pages, total_case_count, total_court_location_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtLocationResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCourtLocation]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_court_location_count (int): Total no. of Court Location for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourtLocationResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByCourtLocationResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtLocationResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCourtLocationResponse', + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "results": [CaseCountAnalyticsByCourtLocation.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalCourtLocationCount": obj.get("totalCourtLocationCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_court_location_count = total_court_location_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_court_response.py b/unicourt/model/case_count_analytics_by_court_response.py index 75cffbe..c88428d 100644 --- a/unicourt/model/case_count_analytics_by_court_response.py +++ b/unicourt/model/case_count_analytics_by_court_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_court import CaseCountAnalyticsByCourt - globals()['CaseCountAnalyticsByCourt'] = CaseCountAnalyticsByCourt - - -class CaseCountAnalyticsByCourtResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 33, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'results': ([CaseCountAnalyticsByCourt],), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_court_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'results': 'results', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_court_count': 'totalCourtCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_court import CaseCountAnalyticsByCourt +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByCourtResponse(BaseModel): + """ + Case Counts by Court. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=33)]] = 'CaseCountAnalyticsByCourtResponse' + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + results: Optional[List[CaseCountAnalyticsByCourt]] = None + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_court_count: Optional[StrictInt] = Field(default=None, description="Total no. of Court for this criteria.", alias="totalCourtCount") + __properties: ClassVar[List[str]] = ["object", "nextPageAPI", "previousPageAPI", "results", "totalPages", "totalCaseCount", "totalCourtCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, next_page_api, previous_page_api, results, total_pages, total_case_count, total_court_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCourt]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_court_count (int): Total no. of Court for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourtResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCourtResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_court_count = total_court_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, next_page_api, previous_page_api, results, total_pages, total_case_count, total_court_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCourt]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_court_count (int): Total no. of Court for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourtResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByCourtResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCourtResponse', + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "results": [CaseCountAnalyticsByCourt.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalCourtCount": obj.get("totalCourtCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_court_count = total_court_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_court_system.py b/unicourt/model/case_count_analytics_by_court_system.py index e462879..1fbaa26 100644 --- a/unicourt/model/case_count_analytics_by_court_system.py +++ b/unicourt/model/case_count_analytics_by_court_system.py @@ -1,309 +1,104 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.case_count_analytics_by_court_geo import CaseCountAnalyticsByCourtGeo - from unicourt.model.court_system import CourtSystem - globals()['CaseCountAnalyticsByCourtGeo'] = CaseCountAnalyticsByCourtGeo - globals()['CourtSystem'] = CourtSystem +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class CaseCountAnalyticsByCourtSystem(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_court_geo import CaseCountAnalyticsByCourtGeo +from unicourt.model.court_system import CourtSystem +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByCourtSystem(BaseModel): """ + CaseCountAnalyticsByCourtSystem + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=31)]] = 'CaseCountAnalyticsByCourtSystem' + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="link to cases for this criteria.", alias="caseSearchAPI") + court_system: Optional[CourtSystem] = Field(default=None, alias="courtSystem") + geo: Optional[CaseCountAnalyticsByCourtGeo] = Field(default=None, alias="Geo") + __properties: ClassVar[List[str]] = ["object", "caseCount", "caseSearchAPI", "courtSystem", "Geo"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 31, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtSystem from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'court_system': (CourtSystem,), # noqa: E501 - 'geo': (CaseCountAnalyticsByCourtGeo,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'court_system': 'courtSystem', # noqa: E501 - 'geo': 'Geo', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of court_system + if self.court_system: + _dict['courtSystem'] = self.court_system.to_dict() + # override the default output from pydantic by calling `to_dict()` of geo + if self.geo: + _dict['Geo'] = self.geo.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_count, case_search_api, court_system, geo, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtSystem - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): link to cases for this criteria. - court_system (CourtSystem): - geo (CaseCountAnalyticsByCourtGeo): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourtSystem" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCourtSystem") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.court_system = court_system - self.geo = geo - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_count, case_search_api, court_system, geo, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtSystem - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): link to cases for this criteria. - court_system (CourtSystem): - geo (CaseCountAnalyticsByCourtGeo): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourtSystem" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtSystem from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByCourtSystem") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCourtSystem', + "caseCount": obj.get("caseCount"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "courtSystem": CourtSystem.from_dict(obj["courtSystem"]) if obj.get("courtSystem") is not None else None, + "Geo": CaseCountAnalyticsByCourtGeo.from_dict(obj["Geo"]) if obj.get("Geo") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.court_system = court_system - self.geo = geo - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_court_system_response.py b/unicourt/model/case_count_analytics_by_court_system_response.py index 84775bf..c0d6c40 100644 --- a/unicourt/model/case_count_analytics_by_court_system_response.py +++ b/unicourt/model/case_count_analytics_by_court_system_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_court_system import CaseCountAnalyticsByCourtSystem - globals()['CaseCountAnalyticsByCourtSystem'] = CaseCountAnalyticsByCourtSystem - - -class CaseCountAnalyticsByCourtSystemResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 39, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'results': ([CaseCountAnalyticsByCourtSystem],), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_court_system_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'results': 'results', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_court_system_count': 'totalCourtSystemCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_court_system import CaseCountAnalyticsByCourtSystem +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByCourtSystemResponse(BaseModel): + """ + Case Counts by Court System. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=39)]] = 'CaseCountAnalyticsByCourtSystemResponse' + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + results: Optional[List[CaseCountAnalyticsByCourtSystem]] = None + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_court_system_count: Optional[StrictInt] = Field(default=None, description="Total no. of Court System for this criteria.", alias="totalCourtSystemCount") + __properties: ClassVar[List[str]] = ["object", "nextPageAPI", "previousPageAPI", "results", "totalPages", "totalCaseCount", "totalCourtSystemCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, next_page_api, previous_page_api, results, total_pages, total_case_count, total_court_system_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtSystemResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCourtSystem]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_court_system_count (int): Total no. of Court System for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourtSystemResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCourtSystemResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtSystemResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_court_system_count = total_court_system_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, next_page_api, previous_page_api, results, total_pages, total_case_count, total_court_system_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtSystemResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCourtSystem]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_court_system_count (int): Total no. of Court System for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourtSystemResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByCourtSystemResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtSystemResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCourtSystemResponse', + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "results": [CaseCountAnalyticsByCourtSystem.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalCourtSystemCount": obj.get("totalCourtSystemCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_court_system_count = total_court_system_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_court_type.py b/unicourt/model/case_count_analytics_by_court_type.py index a737c11..6b73a5a 100644 --- a/unicourt/model/case_count_analytics_by_court_type.py +++ b/unicourt/model/case_count_analytics_by_court_type.py @@ -1,309 +1,104 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.case_count_analytics_by_court_geo import CaseCountAnalyticsByCourtGeo - from unicourt.model.court_type import CourtType - globals()['CaseCountAnalyticsByCourtGeo'] = CaseCountAnalyticsByCourtGeo - globals()['CourtType'] = CourtType +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class CaseCountAnalyticsByCourtType(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_court_geo import CaseCountAnalyticsByCourtGeo +from unicourt.model.court_type import CourtType +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByCourtType(BaseModel): """ + CaseCountAnalyticsByCourtType + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=29)]] = 'CaseCountAnalyticsByCourtType' + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="link to cases for this criteria.", alias="caseSearchAPI") + court_type: Optional[CourtType] = Field(default=None, alias="courtType") + geo: Optional[CaseCountAnalyticsByCourtGeo] = Field(default=None, alias="Geo") + __properties: ClassVar[List[str]] = ["object", "caseCount", "caseSearchAPI", "courtType", "Geo"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 29, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtType from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'court_type': (CourtType,), # noqa: E501 - 'geo': (CaseCountAnalyticsByCourtGeo,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'court_type': 'courtType', # noqa: E501 - 'geo': 'Geo', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of court_type + if self.court_type: + _dict['courtType'] = self.court_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of geo + if self.geo: + _dict['Geo'] = self.geo.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_count, case_search_api, court_type, geo, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtType - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): link to cases for this criteria. - court_type (CourtType): - geo (CaseCountAnalyticsByCourtGeo): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourtType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCourtType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.court_type = court_type - self.geo = geo - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_count, case_search_api, court_type, geo, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtType - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): link to cases for this criteria. - court_type (CourtType): - geo (CaseCountAnalyticsByCourtGeo): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourtType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtType from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByCourtType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCourtType', + "caseCount": obj.get("caseCount"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "courtType": CourtType.from_dict(obj["courtType"]) if obj.get("courtType") is not None else None, + "Geo": CaseCountAnalyticsByCourtGeo.from_dict(obj["Geo"]) if obj.get("Geo") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.court_type = court_type - self.geo = geo - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_court_type_response.py b/unicourt/model/case_count_analytics_by_court_type_response.py index d4a235a..a723f60 100644 --- a/unicourt/model/case_count_analytics_by_court_type_response.py +++ b/unicourt/model/case_count_analytics_by_court_type_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_court_type import CaseCountAnalyticsByCourtType - globals()['CaseCountAnalyticsByCourtType'] = CaseCountAnalyticsByCourtType - - -class CaseCountAnalyticsByCourtTypeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 37, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'results': ([CaseCountAnalyticsByCourtType],), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_court_type_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'results': 'results', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_court_type_count': 'totalCourtTypeCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_court_type import CaseCountAnalyticsByCourtType +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByCourtTypeResponse(BaseModel): + """ + Case Counts by Court Type. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=37)]] = 'CaseCountAnalyticsByCourtTypeResponse' + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + results: Optional[List[CaseCountAnalyticsByCourtType]] = None + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_court_type_count: Optional[StrictInt] = Field(default=None, description="Total no. of Court Type for this criteria.", alias="totalCourtTypeCount") + __properties: ClassVar[List[str]] = ["object", "nextPageAPI", "previousPageAPI", "results", "totalPages", "totalCaseCount", "totalCourtTypeCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, next_page_api, previous_page_api, results, total_pages, total_case_count, total_court_type_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtTypeResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCourtType]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_court_type_count (int): Total no. of Court Type for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourtTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByCourtTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtTypeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_court_type_count = total_court_type_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, next_page_api, previous_page_api, results, total_pages, total_case_count, total_court_type_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByCourtTypeResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByCourtType]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_court_type_count (int): Total no. of Court Type for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByCourtTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByCourtTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByCourtTypeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByCourtTypeResponse', + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "results": [CaseCountAnalyticsByCourtType.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalCourtTypeCount": obj.get("totalCourtTypeCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_court_type_count = total_court_type_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_jurisdiction_geo.py b/unicourt/model/case_count_analytics_by_jurisdiction_geo.py index 8b91049..b533f16 100644 --- a/unicourt/model/case_count_analytics_by_jurisdiction_geo.py +++ b/unicourt/model/case_count_analytics_by_jurisdiction_geo.py @@ -1,309 +1,104 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.case_count_analytics_by_court_geo import CaseCountAnalyticsByCourtGeo - from unicourt.model.jurisdiction_geo import JurisdictionGeo - globals()['CaseCountAnalyticsByCourtGeo'] = CaseCountAnalyticsByCourtGeo - globals()['JurisdictionGeo'] = JurisdictionGeo +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class CaseCountAnalyticsByJurisdictionGeo(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_court_geo import CaseCountAnalyticsByCourtGeo +from unicourt.model.jurisdiction_geo import JurisdictionGeo +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByJurisdictionGeo(BaseModel): """ + CaseCountAnalyticsByJurisdictionGeo + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=35)]] = 'CaseCountAnalyticsByJurisdictionGeo' + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="link to cases for this criteria.", alias="caseSearchAPI") + jurisdiction_geo: Optional[JurisdictionGeo] = Field(default=None, alias="jurisdictionGeo") + geo: Optional[CaseCountAnalyticsByCourtGeo] = Field(default=None, alias="Geo") + __properties: ClassVar[List[str]] = ["object", "caseCount", "caseSearchAPI", "jurisdictionGeo", "Geo"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 35, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByJurisdictionGeo from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'jurisdiction_geo': (JurisdictionGeo,), # noqa: E501 - 'geo': (CaseCountAnalyticsByCourtGeo,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'jurisdiction_geo': 'jurisdictionGeo', # noqa: E501 - 'geo': 'Geo', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of jurisdiction_geo + if self.jurisdiction_geo: + _dict['jurisdictionGeo'] = self.jurisdiction_geo.to_dict() + # override the default output from pydantic by calling `to_dict()` of geo + if self.geo: + _dict['Geo'] = self.geo.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_count, case_search_api, jurisdiction_geo, geo, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByJurisdictionGeo - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): link to cases for this criteria. - jurisdiction_geo (JurisdictionGeo): - geo (CaseCountAnalyticsByCourtGeo): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByJurisdictionGeo" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByJurisdictionGeo") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.jurisdiction_geo = jurisdiction_geo - self.geo = geo - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_count, case_search_api, jurisdiction_geo, geo, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByJurisdictionGeo - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): link to cases for this criteria. - jurisdiction_geo (JurisdictionGeo): - geo (CaseCountAnalyticsByCourtGeo): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByJurisdictionGeo" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByJurisdictionGeo from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByJurisdictionGeo") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByJurisdictionGeo', + "caseCount": obj.get("caseCount"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "jurisdictionGeo": JurisdictionGeo.from_dict(obj["jurisdictionGeo"]) if obj.get("jurisdictionGeo") is not None else None, + "Geo": CaseCountAnalyticsByCourtGeo.from_dict(obj["Geo"]) if obj.get("Geo") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.jurisdiction_geo = jurisdiction_geo - self.geo = geo - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_jurisdiction_geo_response.py b/unicourt/model/case_count_analytics_by_jurisdiction_geo_response.py index cb98f84..8fddf47 100644 --- a/unicourt/model/case_count_analytics_by_jurisdiction_geo_response.py +++ b/unicourt/model/case_count_analytics_by_jurisdiction_geo_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_jurisdiction_geo import CaseCountAnalyticsByJurisdictionGeo - globals()['CaseCountAnalyticsByJurisdictionGeo'] = CaseCountAnalyticsByJurisdictionGeo - - -class CaseCountAnalyticsByJurisdictionGeoResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 43, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'results': ([CaseCountAnalyticsByJurisdictionGeo],), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_jurisdiction_geo_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'results': 'results', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_jurisdiction_geo_count': 'totalJurisdictionGeoCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_jurisdiction_geo import CaseCountAnalyticsByJurisdictionGeo +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByJurisdictionGeoResponse(BaseModel): + """ + Case Counts by Juridiction Geo Response. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=43)]] = 'CaseCountAnalyticsByJurisdictionGeoResponse' + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + results: Optional[List[CaseCountAnalyticsByJurisdictionGeo]] = None + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_jurisdiction_geo_count: Optional[StrictInt] = Field(default=None, description="Total no. of Jurisdiction for this criteria.", alias="totalJurisdictionGeoCount") + __properties: ClassVar[List[str]] = ["object", "nextPageAPI", "previousPageAPI", "results", "totalPages", "totalCaseCount", "totalJurisdictionGeoCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, next_page_api, previous_page_api, results, total_pages, total_case_count, total_jurisdiction_geo_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByJurisdictionGeoResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByJurisdictionGeo]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_jurisdiction_geo_count (int): Total no. of Jurisdiction for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByJurisdictionGeoResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByJurisdictionGeoResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByJurisdictionGeoResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_jurisdiction_geo_count = total_jurisdiction_geo_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, next_page_api, previous_page_api, results, total_pages, total_case_count, total_jurisdiction_geo_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByJurisdictionGeoResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByJurisdictionGeo]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_jurisdiction_geo_count (int): Total no. of Jurisdiction for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByJurisdictionGeoResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByJurisdictionGeoResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByJurisdictionGeoResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByJurisdictionGeoResponse', + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "results": [CaseCountAnalyticsByJurisdictionGeo.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalJurisdictionGeoCount": obj.get("totalJurisdictionGeoCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_jurisdiction_geo_count = total_jurisdiction_geo_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_norm_attorney.py b/unicourt/model/case_count_analytics_by_norm_attorney.py index 307664b..2d60e46 100644 --- a/unicourt/model/case_count_analytics_by_norm_attorney.py +++ b/unicourt/model/case_count_analytics_by_norm_attorney.py @@ -1,308 +1,101 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CaseCountAnalyticsByNormAttorney(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByNormAttorney(BaseModel): """ + CaseCountAnalyticsByNormAttorney + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=32)]] = 'CaseCountAnalyticsByNormAttorney' + norm_attorney_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normAttorneyId") + norm_attorney_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="normAttorneyName") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to cases for this criteria.", alias="caseSearchAPI") + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + __properties: ClassVar[List[str]] = ["object", "normAttorneyId", "normAttorneyName", "caseSearchAPI", "caseCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 32, - }, - ('norm_attorney_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('norm_attorney_name',): { - 'max_length': 500, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormAttorney from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'norm_attorney_id': (str,), # noqa: E501 - 'norm_attorney_name': (str,), # noqa: E501 - 'case_search_api': (str, none_type,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if case_search_api (nullable) is None + # and model_fields_set contains the field + if self.case_search_api is None and "case_search_api" in self.model_fields_set: + _dict['caseSearchAPI'] = None - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_attorney_id': 'normAttorneyId', # noqa: E501 - 'norm_attorney_name': 'normAttorneyName', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_attorney_id, norm_attorney_name, case_search_api, case_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormAttorney - a model defined in OpenAPI - - Args: - norm_attorney_id (str): - norm_attorney_name (str): - case_search_api (str, none_type): Link to cases for this criteria. - case_count (int): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormAttorney" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByNormAttorney") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_attorney_id = norm_attorney_id - self.norm_attorney_name = norm_attorney_name - self.case_search_api = case_search_api - self.case_count = case_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_attorney_id, norm_attorney_name, case_search_api, case_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormAttorney - a model defined in OpenAPI - - Args: - norm_attorney_id (str): - norm_attorney_name (str): - case_search_api (str, none_type): Link to cases for this criteria. - case_count (int): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormAttorney" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormAttorney from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByNormAttorney") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByNormAttorney', + "normAttorneyId": obj.get("normAttorneyId"), + "normAttorneyName": obj.get("normAttorneyName"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseCount": obj.get("caseCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_attorney_id = norm_attorney_id - self.norm_attorney_name = norm_attorney_name - self.case_search_api = case_search_api - self.case_count = case_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_norm_attorney_response.py b/unicourt/model/case_count_analytics_by_norm_attorney_response.py index 0edbdd2..085055b 100644 --- a/unicourt/model/case_count_analytics_by_norm_attorney_response.py +++ b/unicourt/model/case_count_analytics_by_norm_attorney_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_norm_attorney import CaseCountAnalyticsByNormAttorney - globals()['CaseCountAnalyticsByNormAttorney'] = CaseCountAnalyticsByNormAttorney - - -class CaseCountAnalyticsByNormAttorneyResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 40, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'results': ([CaseCountAnalyticsByNormAttorney],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_norm_attorney_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'results': 'results', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_norm_attorney_count': 'totalNormAttorneyCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_norm_attorney import CaseCountAnalyticsByNormAttorney +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByNormAttorneyResponse(BaseModel): + """ + CaseCountAnalyticsByNormAttorneyResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=40)]] = 'CaseCountAnalyticsByNormAttorneyResponse' + results: Optional[List[CaseCountAnalyticsByNormAttorney]] = None + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_norm_attorney_count: Optional[StrictInt] = Field(default=None, description="Total no. of NormAttorney for this criteria.", alias="totalNormAttorneyCount") + __properties: ClassVar[List[str]] = ["object", "results", "nextPageAPI", "previousPageAPI", "totalPages", "totalCaseCount", "totalNormAttorneyCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, results, next_page_api, previous_page_api, total_pages, total_case_count, total_norm_attorney_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormAttorneyResponse - a model defined in OpenAPI - - Args: - results ([CaseCountAnalyticsByNormAttorney]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_norm_attorney_count (int): Total no. of NormAttorney for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormAttorneyResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByNormAttorneyResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormAttorneyResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.results = results - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_norm_attorney_count = total_norm_attorney_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, results, next_page_api, previous_page_api, total_pages, total_case_count, total_norm_attorney_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormAttorneyResponse - a model defined in OpenAPI - - Args: - results ([CaseCountAnalyticsByNormAttorney]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_norm_attorney_count (int): Total no. of NormAttorney for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormAttorneyResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByNormAttorneyResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormAttorneyResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByNormAttorneyResponse', + "results": [CaseCountAnalyticsByNormAttorney.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalNormAttorneyCount": obj.get("totalNormAttorneyCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.results = results - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_norm_attorney_count = total_norm_attorney_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_norm_judge.py b/unicourt/model/case_count_analytics_by_norm_judge.py index 37c963d..2d339c3 100644 --- a/unicourt/model/case_count_analytics_by_norm_judge.py +++ b/unicourt/model/case_count_analytics_by_norm_judge.py @@ -1,308 +1,96 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CaseCountAnalyticsByNormJudge(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByNormJudge(BaseModel): """ + CaseCountAnalyticsByNormJudge + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=29)]] = 'CaseCountAnalyticsByNormJudge' + norm_judge_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normJudgeId") + norm_judge_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="normJudgeName") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to cases for this criteria.", alias="caseSearchAPI") + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + __properties: ClassVar[List[str]] = ["object", "normJudgeId", "normJudgeName", "caseSearchAPI", "caseCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 29, - }, - ('norm_judge_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('norm_judge_name',): { - 'max_length': 500, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormJudge from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'norm_judge_id': (str,), # noqa: E501 - 'norm_judge_name': (str,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_judge_id': 'normJudgeId', # noqa: E501 - 'norm_judge_name': 'normJudgeName', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_judge_id, norm_judge_name, case_search_api, case_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormJudge - a model defined in OpenAPI - - Args: - norm_judge_id (str): - norm_judge_name (str): - case_search_api (str): Link to cases for this criteria. - case_count (int): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormJudge" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByNormJudge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_judge_id = norm_judge_id - self.norm_judge_name = norm_judge_name - self.case_search_api = case_search_api - self.case_count = case_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_judge_id, norm_judge_name, case_search_api, case_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormJudge - a model defined in OpenAPI - - Args: - norm_judge_id (str): - norm_judge_name (str): - case_search_api (str): Link to cases for this criteria. - case_count (int): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormJudge" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormJudge from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByNormJudge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByNormJudge', + "normJudgeId": obj.get("normJudgeId"), + "normJudgeName": obj.get("normJudgeName"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseCount": obj.get("caseCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_judge_id = norm_judge_id - self.norm_judge_name = norm_judge_name - self.case_search_api = case_search_api - self.case_count = case_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_norm_judge_response.py b/unicourt/model/case_count_analytics_by_norm_judge_response.py index e5a3238..b070f36 100644 --- a/unicourt/model/case_count_analytics_by_norm_judge_response.py +++ b/unicourt/model/case_count_analytics_by_norm_judge_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_norm_judge import CaseCountAnalyticsByNormJudge - globals()['CaseCountAnalyticsByNormJudge'] = CaseCountAnalyticsByNormJudge - - -class CaseCountAnalyticsByNormJudgeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 37, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'results': ([CaseCountAnalyticsByNormJudge],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_norm_judge_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'results': 'results', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_norm_judge_count': 'totalNormJudgeCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_norm_judge import CaseCountAnalyticsByNormJudge +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByNormJudgeResponse(BaseModel): + """ + CaseCountAnalyticsByNormJudgeResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=37)]] = 'CaseCountAnalyticsByNormJudgeResponse' + results: Optional[List[CaseCountAnalyticsByNormJudge]] = None + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_norm_judge_count: Optional[StrictInt] = Field(default=None, description="Total no. of NormJudge for this criteria.", alias="totalNormJudgeCount") + __properties: ClassVar[List[str]] = ["object", "results", "nextPageAPI", "previousPageAPI", "totalPages", "totalCaseCount", "totalNormJudgeCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, results, next_page_api, previous_page_api, total_pages, total_case_count, total_norm_judge_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormJudgeResponse - a model defined in OpenAPI - - Args: - results ([CaseCountAnalyticsByNormJudge]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_norm_judge_count (int): Total no. of NormJudge for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormJudgeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByNormJudgeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormJudgeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.results = results - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_norm_judge_count = total_norm_judge_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, results, next_page_api, previous_page_api, total_pages, total_case_count, total_norm_judge_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormJudgeResponse - a model defined in OpenAPI - - Args: - results ([CaseCountAnalyticsByNormJudge]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_norm_judge_count (int): Total no. of NormJudge for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormJudgeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByNormJudgeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormJudgeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByNormJudgeResponse', + "results": [CaseCountAnalyticsByNormJudge.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalNormJudgeCount": obj.get("totalNormJudgeCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.results = results - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_norm_judge_count = total_norm_judge_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_norm_law_firm.py b/unicourt/model/case_count_analytics_by_norm_law_firm.py index b0db5af..a659236 100644 --- a/unicourt/model/case_count_analytics_by_norm_law_firm.py +++ b/unicourt/model/case_count_analytics_by_norm_law_firm.py @@ -1,308 +1,101 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CaseCountAnalyticsByNormLawFirm(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByNormLawFirm(BaseModel): """ + CaseCountAnalyticsByNormLawFirm + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=31)]] = 'CaseCountAnalyticsByNormLawFirm' + norm_law_firm_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normLawFirmId") + norm_law_firm_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="normLawFirmName") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to cases for this criteria.", alias="caseSearchAPI") + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + __properties: ClassVar[List[str]] = ["object", "normLawFirmId", "normLawFirmName", "caseSearchAPI", "caseCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 31, - }, - ('norm_law_firm_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('norm_law_firm_name',): { - 'max_length': 500, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormLawFirm from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'norm_law_firm_id': (str,), # noqa: E501 - 'norm_law_firm_name': (str,), # noqa: E501 - 'case_search_api': (str, none_type,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if case_search_api (nullable) is None + # and model_fields_set contains the field + if self.case_search_api is None and "case_search_api" in self.model_fields_set: + _dict['caseSearchAPI'] = None - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_law_firm_id': 'normLawFirmId', # noqa: E501 - 'norm_law_firm_name': 'normLawFirmName', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_law_firm_id, norm_law_firm_name, case_search_api, case_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormLawFirm - a model defined in OpenAPI - - Args: - norm_law_firm_id (str): - norm_law_firm_name (str): - case_search_api (str, none_type): Link to cases for this criteria. - case_count (int): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormLawFirm" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByNormLawFirm") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_law_firm_id = norm_law_firm_id - self.norm_law_firm_name = norm_law_firm_name - self.case_search_api = case_search_api - self.case_count = case_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_law_firm_id, norm_law_firm_name, case_search_api, case_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormLawFirm - a model defined in OpenAPI - - Args: - norm_law_firm_id (str): - norm_law_firm_name (str): - case_search_api (str, none_type): Link to cases for this criteria. - case_count (int): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormLawFirm" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormLawFirm from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByNormLawFirm") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByNormLawFirm', + "normLawFirmId": obj.get("normLawFirmId"), + "normLawFirmName": obj.get("normLawFirmName"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseCount": obj.get("caseCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_law_firm_id = norm_law_firm_id - self.norm_law_firm_name = norm_law_firm_name - self.case_search_api = case_search_api - self.case_count = case_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_norm_law_firm_response.py b/unicourt/model/case_count_analytics_by_norm_law_firm_response.py index 93b6632..c34fc56 100644 --- a/unicourt/model/case_count_analytics_by_norm_law_firm_response.py +++ b/unicourt/model/case_count_analytics_by_norm_law_firm_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_norm_law_firm import CaseCountAnalyticsByNormLawFirm - globals()['CaseCountAnalyticsByNormLawFirm'] = CaseCountAnalyticsByNormLawFirm - - -class CaseCountAnalyticsByNormLawFirmResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 39, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'results': ([CaseCountAnalyticsByNormLawFirm],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_norm_law_firm_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'results': 'results', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_norm_law_firm_count': 'totalNormLawFirmCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_norm_law_firm import CaseCountAnalyticsByNormLawFirm +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByNormLawFirmResponse(BaseModel): + """ + CaseCountAnalyticsByNormLawFirmResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=39)]] = 'CaseCountAnalyticsByNormLawFirmResponse' + results: Optional[List[CaseCountAnalyticsByNormLawFirm]] = None + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_norm_law_firm_count: Optional[StrictInt] = Field(default=None, description="Total no. of NormLawFirm for this criteria.", alias="totalNormLawFirmCount") + __properties: ClassVar[List[str]] = ["object", "results", "nextPageAPI", "previousPageAPI", "totalPages", "totalCaseCount", "totalNormLawFirmCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, results, next_page_api, previous_page_api, total_pages, total_case_count, total_norm_law_firm_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormLawFirmResponse - a model defined in OpenAPI - - Args: - results ([CaseCountAnalyticsByNormLawFirm]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_norm_law_firm_count (int): Total no. of NormLawFirm for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormLawFirmResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByNormLawFirmResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormLawFirmResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.results = results - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_norm_law_firm_count = total_norm_law_firm_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, results, next_page_api, previous_page_api, total_pages, total_case_count, total_norm_law_firm_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormLawFirmResponse - a model defined in OpenAPI - - Args: - results ([CaseCountAnalyticsByNormLawFirm]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_norm_law_firm_count (int): Total no. of NormLawFirm for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormLawFirmResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByNormLawFirmResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormLawFirmResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByNormLawFirmResponse', + "results": [CaseCountAnalyticsByNormLawFirm.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalNormLawFirmCount": obj.get("totalNormLawFirmCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.results = results - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_norm_law_firm_count = total_norm_law_firm_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_norm_party.py b/unicourt/model/case_count_analytics_by_norm_party.py index 4ad6c74..43afbd3 100644 --- a/unicourt/model/case_count_analytics_by_norm_party.py +++ b/unicourt/model/case_count_analytics_by_norm_party.py @@ -1,308 +1,101 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CaseCountAnalyticsByNormParty(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByNormParty(BaseModel): """ + CaseCountAnalyticsByNormParty + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=29)]] = 'CaseCountAnalyticsByNormParty' + norm_party_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normPartyId") + norm_party_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="normPartyName") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to cases for this criteria.", alias="caseSearchAPI") + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + __properties: ClassVar[List[str]] = ["object", "normPartyId", "normPartyName", "caseSearchAPI", "caseCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 29, - }, - ('norm_party_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('norm_party_name',): { - 'max_length': 500, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormParty from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'norm_party_id': (str,), # noqa: E501 - 'norm_party_name': (str,), # noqa: E501 - 'case_search_api': (str, none_type,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if case_search_api (nullable) is None + # and model_fields_set contains the field + if self.case_search_api is None and "case_search_api" in self.model_fields_set: + _dict['caseSearchAPI'] = None - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_party_id': 'normPartyId', # noqa: E501 - 'norm_party_name': 'normPartyName', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_party_id, norm_party_name, case_search_api, case_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormParty - a model defined in OpenAPI - - Args: - norm_party_id (str): - norm_party_name (str): - case_search_api (str, none_type): Link to cases for this criteria. - case_count (int): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormParty" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByNormParty") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_party_id = norm_party_id - self.norm_party_name = norm_party_name - self.case_search_api = case_search_api - self.case_count = case_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_party_id, norm_party_name, case_search_api, case_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormParty - a model defined in OpenAPI - - Args: - norm_party_id (str): - norm_party_name (str): - case_search_api (str, none_type): Link to cases for this criteria. - case_count (int): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormParty" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormParty from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByNormParty") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByNormParty', + "normPartyId": obj.get("normPartyId"), + "normPartyName": obj.get("normPartyName"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseCount": obj.get("caseCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_party_id = norm_party_id - self.norm_party_name = norm_party_name - self.case_search_api = case_search_api - self.case_count = case_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_norm_party_response.py b/unicourt/model/case_count_analytics_by_norm_party_response.py index 2aac220..d3bd9c8 100644 --- a/unicourt/model/case_count_analytics_by_norm_party_response.py +++ b/unicourt/model/case_count_analytics_by_norm_party_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_norm_party import CaseCountAnalyticsByNormParty - globals()['CaseCountAnalyticsByNormParty'] = CaseCountAnalyticsByNormParty - - -class CaseCountAnalyticsByNormPartyResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 37, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'results': ([CaseCountAnalyticsByNormParty],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_norm_party_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'results': 'results', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_norm_party_count': 'totalNormPartyCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_norm_party import CaseCountAnalyticsByNormParty +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByNormPartyResponse(BaseModel): + """ + CaseCountAnalyticsByNormPartyResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=37)]] = 'CaseCountAnalyticsByNormPartyResponse' + results: Optional[List[CaseCountAnalyticsByNormParty]] = None + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_norm_party_count: Optional[StrictInt] = Field(default=None, description="Total no. of NormParty for this criteria.", alias="totalNormPartyCount") + __properties: ClassVar[List[str]] = ["object", "results", "nextPageAPI", "previousPageAPI", "totalPages", "totalCaseCount", "totalNormPartyCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, results, next_page_api, previous_page_api, total_pages, total_case_count, total_norm_party_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormPartyResponse - a model defined in OpenAPI - - Args: - results ([CaseCountAnalyticsByNormParty]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_norm_party_count (int): Total no. of NormParty for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormPartyResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByNormPartyResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormPartyResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.results = results - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_norm_party_count = total_norm_party_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, results, next_page_api, previous_page_api, total_pages, total_case_count, total_norm_party_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByNormPartyResponse - a model defined in OpenAPI - - Args: - results ([CaseCountAnalyticsByNormParty]): - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_norm_party_count (int): Total no. of NormParty for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByNormPartyResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByNormPartyResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByNormPartyResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByNormPartyResponse', + "results": [CaseCountAnalyticsByNormParty.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalNormPartyCount": obj.get("totalNormPartyCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.results = results - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_norm_party_count = total_norm_party_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_party_role.py b/unicourt/model/case_count_analytics_by_party_role.py index 01d6f78..d3d20a9 100644 --- a/unicourt/model/case_count_analytics_by_party_role.py +++ b/unicourt/model/case_count_analytics_by_party_role.py @@ -1,301 +1,98 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.party_role import PartyRole - globals()['PartyRole'] = PartyRole +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class CaseCountAnalyticsByPartyRole(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.party_role import PartyRole +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByPartyRole(BaseModel): """ + CaseCountAnalyticsByPartyRole + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=29)]] = 'CaseCountAnalyticsByPartyRole' + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to cases for the entity involving the search criteria. TBD.", alias="caseSearchAPI") + party_role: Optional[PartyRole] = Field(default=None, alias="partyRole") + __properties: ClassVar[List[str]] = ["object", "caseCount", "caseSearchAPI", "partyRole"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 29, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByPartyRole from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'party_role': (PartyRole,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'party_role': 'partyRole', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of party_role + if self.party_role: + _dict['partyRole'] = self.party_role.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_count, case_search_api, party_role, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByPartyRole - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): Link to cases for the entity involving the search criteria. TBD. - party_role (PartyRole): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByPartyRole" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByPartyRole") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.party_role = party_role - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_count, case_search_api, party_role, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByPartyRole - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): Link to cases for the entity involving the search criteria. TBD. - party_role (PartyRole): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByPartyRole" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByPartyRole from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByPartyRole") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByPartyRole', + "caseCount": obj.get("caseCount"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "partyRole": PartyRole.from_dict(obj["partyRole"]) if obj.get("partyRole") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.party_role = party_role - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_party_role_group.py b/unicourt/model/case_count_analytics_by_party_role_group.py index af8c4fd..57da580 100644 --- a/unicourt/model/case_count_analytics_by_party_role_group.py +++ b/unicourt/model/case_count_analytics_by_party_role_group.py @@ -1,301 +1,98 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.party_role_group import PartyRoleGroup - globals()['PartyRoleGroup'] = PartyRoleGroup +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class CaseCountAnalyticsByPartyRoleGroup(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.party_role_group import PartyRoleGroup +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseCountAnalyticsByPartyRoleGroup(BaseModel): """ + CaseCountAnalyticsByPartyRoleGroup + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=34)]] = 'CaseCountAnalyticsByPartyRoleGroup' + case_count: Optional[StrictInt] = Field(default=None, alias="caseCount") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to cases for the entity involving the search criteria. TBD.", alias="caseSearchAPI") + party_role_group: Optional[PartyRoleGroup] = Field(default=None, alias="partyRoleGroup") + __properties: ClassVar[List[str]] = ["object", "caseCount", "caseSearchAPI", "partyRoleGroup"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 34, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByPartyRoleGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_count': (int,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'party_role_group': (PartyRoleGroup,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_count': 'caseCount', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'party_role_group': 'partyRoleGroup', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of party_role_group + if self.party_role_group: + _dict['partyRoleGroup'] = self.party_role_group.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_count, case_search_api, party_role_group, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByPartyRoleGroup - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): Link to cases for the entity involving the search criteria. TBD. - party_role_group (PartyRoleGroup): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByPartyRoleGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByPartyRoleGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.party_role_group = party_role_group - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_count, case_search_api, party_role_group, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByPartyRoleGroup - a model defined in OpenAPI - - Args: - case_count (int): - case_search_api (str): Link to cases for the entity involving the search criteria. TBD. - party_role_group (PartyRoleGroup): - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByPartyRoleGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByPartyRoleGroup from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseCountAnalyticsByPartyRoleGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByPartyRoleGroup', + "caseCount": obj.get("caseCount"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "partyRoleGroup": PartyRoleGroup.from_dict(obj["partyRoleGroup"]) if obj.get("partyRoleGroup") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_count = case_count - self.case_search_api = case_search_api - self.party_role_group = party_role_group - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_party_role_group_response.py b/unicourt/model/case_count_analytics_by_party_role_group_response.py index 831f149..82daa8b 100644 --- a/unicourt/model/case_count_analytics_by_party_role_group_response.py +++ b/unicourt/model/case_count_analytics_by_party_role_group_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_party_role_group import CaseCountAnalyticsByPartyRoleGroup - globals()['CaseCountAnalyticsByPartyRoleGroup'] = CaseCountAnalyticsByPartyRoleGroup - - -class CaseCountAnalyticsByPartyRoleGroupResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 42, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'results': ([CaseCountAnalyticsByPartyRoleGroup],), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_party_role_group_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'results': 'results', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_party_role_group_count': 'totalPartyRoleGroupCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_party_role_group import CaseCountAnalyticsByPartyRoleGroup +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByPartyRoleGroupResponse(BaseModel): + """ + Case Count by Party Type Group Response. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=42)]] = 'CaseCountAnalyticsByPartyRoleGroupResponse' + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + results: Optional[List[CaseCountAnalyticsByPartyRoleGroup]] = None + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_party_role_group_count: Optional[StrictInt] = Field(default=None, description="Total no. of Party Role Group for this criteria.", alias="totalPartyRoleGroupCount") + __properties: ClassVar[List[str]] = ["object", "nextPageAPI", "previousPageAPI", "results", "totalPages", "totalCaseCount", "totalPartyRoleGroupCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, next_page_api, previous_page_api, results, total_pages, total_case_count, total_party_role_group_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByPartyRoleGroupResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByPartyRoleGroup]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_party_role_group_count (int): Total no. of Party Role Group for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByPartyRoleGroupResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByPartyRoleGroupResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByPartyRoleGroupResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_party_role_group_count = total_party_role_group_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, next_page_api, previous_page_api, results, total_pages, total_case_count, total_party_role_group_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByPartyRoleGroupResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByPartyRoleGroup]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_party_role_group_count (int): Total no. of Party Role Group for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByPartyRoleGroupResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByPartyRoleGroupResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByPartyRoleGroupResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByPartyRoleGroupResponse', + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "results": [CaseCountAnalyticsByPartyRoleGroup.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalPartyRoleGroupCount": obj.get("totalPartyRoleGroupCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_party_role_group_count = total_party_role_group_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_count_analytics_by_party_role_response.py b/unicourt/model/case_count_analytics_by_party_role_response.py index fdae461..dbc643b 100644 --- a/unicourt/model/case_count_analytics_by_party_role_response.py +++ b/unicourt/model/case_count_analytics_by_party_role_response.py @@ -1,322 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_count_analytics_by_party_role import CaseCountAnalyticsByPartyRole - globals()['CaseCountAnalyticsByPartyRole'] = CaseCountAnalyticsByPartyRole - - -class CaseCountAnalyticsByPartyRoleResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 37, - }, - ('next_page_api',): { - 'max_length': 2173, - }, - ('previous_page_api',): { - 'max_length': 2172, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'results': ([CaseCountAnalyticsByPartyRole],), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_party_role_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'results': 'results', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_party_role_count': 'totalPartyRoleCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_party_role import CaseCountAnalyticsByPartyRole +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseCountAnalyticsByPartyRoleResponse(BaseModel): + """ + Case Count by Party Type Response. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=37)]] = 'CaseCountAnalyticsByPartyRoleResponse' + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=2173)]] = Field(default=None, description="Next page of results if applicable.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(strict=True, max_length=2172)]] = Field(default=None, description="Link to previous page of results.", alias="previousPageAPI") + results: Optional[List[CaseCountAnalyticsByPartyRole]] = None + total_pages: Optional[StrictInt] = Field(default=None, description="Total no. of pages.", alias="totalPages") + total_case_count: Optional[StrictInt] = Field(default=None, description="Total no. of Cases for this criteria.", alias="totalCaseCount") + total_party_role_count: Optional[StrictInt] = Field(default=None, description="Total no. of Party Role for this criteria.", alias="totalPartyRoleCount") + __properties: ClassVar[List[str]] = ["object", "nextPageAPI", "previousPageAPI", "results", "totalPages", "totalCaseCount", "totalPartyRoleCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, next_page_api, previous_page_api, results, total_pages, total_case_count, total_party_role_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByPartyRoleResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByPartyRole]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_party_role_count (int): Total no. of Party Role for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByPartyRoleResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseCountAnalyticsByPartyRoleResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByPartyRoleResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_party_role_count = total_party_role_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, next_page_api, previous_page_api, results, total_pages, total_case_count, total_party_role_count, *args, **kwargs): # noqa: E501 - """CaseCountAnalyticsByPartyRoleResponse - a model defined in OpenAPI - - Args: - next_page_api (str, none_type): Next page of results if applicable. - previous_page_api (str, none_type): Link to previous page of results. - results ([CaseCountAnalyticsByPartyRole]): - total_pages (int): Total no. of pages. - total_case_count (int): Total no. of Cases for this criteria. - total_party_role_count (int): Total no. of Party Role for this criteria. - - Keyword Args: - object (str): defaults to "CaseCountAnalyticsByPartyRoleResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item in self.results: + if _item: + _items.append(_item.to_dict()) + _dict['results'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseCountAnalyticsByPartyRoleResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseCountAnalyticsByPartyRoleResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseCountAnalyticsByPartyRoleResponse', + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "results": [CaseCountAnalyticsByPartyRole.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "totalPages": obj.get("totalPages"), + "totalCaseCount": obj.get("totalCaseCount"), + "totalPartyRoleCount": obj.get("totalPartyRoleCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.results = results - self.total_pages = total_pages - self.total_case_count = total_case_count - self.total_party_role_count = total_party_role_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_document.py b/unicourt/model/case_document.py index 05fb1f5..f741cbc 100644 --- a/unicourt/model/case_document.py +++ b/unicourt/model/case_document.py @@ -1,432 +1,196 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations +import pprint import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.preview_document import PreviewDocument - globals()['PreviewDocument'] = PreviewDocument - - -class CaseDocument(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from unicourt.model.preview_document import PreviewDocument +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseDocument(BaseModel): """ + CaseDocument + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=12, strict=True, max_length=12)]] = Field(default='CaseDocument', description="Name of the object") + case_document_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="UniCourt's Case Document ID.", alias="caseDocumentId") + sort_order: Optional[StrictInt] = Field(default=None, description="Order of documents how it is being stored in UniCourt.", alias="sortOrder") + name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Document name.") + description: Optional[StrictStr] = Field(default=None, description="Description of the document.") + document_filed_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="Document Date when it was filed. The document date will be either explicitly provided byt the court or if the document is associatated to a docket entry then the document date will be of docket entry date.", alias="documentFiledDate") + parent_document_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Document ID which is the parent document for the current document. This will be null if the current document is a parent document.", alias="parentDocumentId") + child_document_id_array: Optional[List[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]]]] = Field(default=None, description="List of child document ID's if exists or else it will be an empty lsit.", alias="childDocumentIdArray") + pages: Optional[StrictInt] = Field(default=None, description="Total number of pages in the document.") + is_preview_available: Optional[StrictBool] = Field(default=None, description="Determines if a preview is available for the case document.", alias="isPreviewAvailable") + preview_document: Optional[PreviewDocument] = Field(default=None, alias="previewDocument") + price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Price of the document.") + in_library: Optional[StrictBool] = Field(default=None, description="Determines if the document is present in the UniCourt Library or not.", alias="inLibrary") + added_to_library_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="Date and time when the document was downloaded and added to the UniCourt Crowd Source Library.", alias="addedToLibraryDate") + estimated_order_duration: Optional[Annotated[str, Field(min_length=10, strict=True, max_length=25)]] = Field(default='estimateUnavailable', description="Estimated duration of a Order.", alias="estimatedOrderDuration") + download_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to either view the document if it is downloaded and already present in the UniCourt CrowdSourced Library.", alias="downloadAPI") + first_fetch_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="Is the date when the document was first fetched from the court site.", alias="firstFetchDate") + source_data_status: Optional[StrictStr] = Field(default=None, description="The status of source data of document. If the value of sourceDataStatus is SOURCE_DEPRECATED then it means that the Document has been migrated from old court site to a new court site and the data being shown in the API response is from a old court site. If the sourceDataStatus is NO_LONGER_AVAILABLE_IN_COURT then it means that a particular case is invalid in the court site.", alias="sourceDataStatus") + __properties: ClassVar[List[str]] = ["object", "caseDocumentId", "sortOrder", "name", "description", "documentFiledDate", "parentDocumentId", "childDocumentIdArray", "pages", "isPreviewAvailable", "previewDocument", "price", "inLibrary", "addedToLibraryDate", "estimatedOrderDuration", "downloadAPI", "firstFetchDate", "sourceDataStatus"] + + @field_validator('estimated_order_duration') + def estimated_order_duration_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['estimateUnavailable', 'withinMinutes', 'withinHours', 'withinDays', 'withinWeeks']): + raise ValueError("must be one of enum values ('estimateUnavailable', 'withinMinutes', 'withinHours', 'withinDays', 'withinWeeks')") + return value + + @field_validator('source_data_status') + def source_data_status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['NO_LONGER_AVAILABLE_IN_COURT', 'SEALED', 'null']): + raise ValueError("must be one of enum values ('NO_LONGER_AVAILABLE_IN_COURT', 'SEALED', 'null')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('estimated_order_duration',): { - 'ESTIMATEUNAVAILABLE': "estimateUnavailable", - 'WITHINMINUTES': "withinMinutes", - 'WITHINHOURS': "withinHours", - 'WITHINDAYS': "withinDays", - 'WITHINWEEKS': "withinWeeks", - }, - ('source_data_status',): { - 'None': None, - 'NO_LONGER_AVAILABLE_IN_COURT': "NO_LONGER_AVAILABLE_IN_COURT", - 'SOURCE_DEPRECATED': "SOURCE_DEPRECATED", - 'SEALED': "SEALED", - 'NULL': "null", - }, - } - - validations = { - ('object',): { - 'max_length': 12, - 'min_length': 12, - }, - ('case_document_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 255, - }, - ('description',): { - 'max_length': 100000, - }, - ('document_filed_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('parent_document_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('added_to_library_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('estimated_order_duration',): { - 'max_length': 25, - 'min_length': 10, - }, - ('download_api',): { - 'max_length': 255, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseDocument from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_document_id': (str,), # noqa: E501 - 'sort_order': (int, none_type,), # noqa: E501 - 'name': (str, none_type,), # noqa: E501 - 'description': (str, none_type,), # noqa: E501 - 'document_filed_date': (str, none_type,), # noqa: E501 - 'parent_document_id': (str, none_type,), # noqa: E501 - 'child_document_id_array': ([str, none_type],), # noqa: E501 - 'pages': (int, none_type,), # noqa: E501 - 'is_preview_available': (bool,), # noqa: E501 - 'preview_document': (PreviewDocument,), # noqa: E501 - 'price': (float, none_type,), # noqa: E501 - 'in_library': (bool,), # noqa: E501 - 'added_to_library_date': (str, none_type,), # noqa: E501 - 'estimated_order_duration': (str,), # noqa: E501 - 'download_api': (str, none_type,), # noqa: E501 - 'first_fetch_date': (str,), # noqa: E501 - 'source_data_status': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_document_id': 'caseDocumentId', # noqa: E501 - 'sort_order': 'sortOrder', # noqa: E501 - 'name': 'name', # noqa: E501 - 'description': 'description', # noqa: E501 - 'document_filed_date': 'documentFiledDate', # noqa: E501 - 'parent_document_id': 'parentDocumentId', # noqa: E501 - 'child_document_id_array': 'childDocumentIdArray', # noqa: E501 - 'pages': 'pages', # noqa: E501 - 'is_preview_available': 'isPreviewAvailable', # noqa: E501 - 'preview_document': 'previewDocument', # noqa: E501 - 'price': 'price', # noqa: E501 - 'in_library': 'inLibrary', # noqa: E501 - 'added_to_library_date': 'addedToLibraryDate', # noqa: E501 - 'estimated_order_duration': 'estimatedOrderDuration', # noqa: E501 - 'download_api': 'downloadAPI', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'source_data_status': 'sourceDataStatus', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of preview_document + if self.preview_document: + _dict['previewDocument'] = self.preview_document.to_dict() + # set to None if sort_order (nullable) is None + # and model_fields_set contains the field + if self.sort_order is None and "sort_order" in self.model_fields_set: + _dict['sortOrder'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if document_filed_date (nullable) is None + # and model_fields_set contains the field + if self.document_filed_date is None and "document_filed_date" in self.model_fields_set: + _dict['documentFiledDate'] = None + + # set to None if parent_document_id (nullable) is None + # and model_fields_set contains the field + if self.parent_document_id is None and "parent_document_id" in self.model_fields_set: + _dict['parentDocumentId'] = None + + # set to None if pages (nullable) is None + # and model_fields_set contains the field + if self.pages is None and "pages" in self.model_fields_set: + _dict['pages'] = None + + # set to None if price (nullable) is None + # and model_fields_set contains the field + if self.price is None and "price" in self.model_fields_set: + _dict['price'] = None + + # set to None if added_to_library_date (nullable) is None + # and model_fields_set contains the field + if self.added_to_library_date is None and "added_to_library_date" in self.model_fields_set: + _dict['addedToLibraryDate'] = None + + # set to None if download_api (nullable) is None + # and model_fields_set contains the field + if self.download_api is None and "download_api" in self.model_fields_set: + _dict['downloadAPI'] = None + + # set to None if source_data_status (nullable) is None + # and model_fields_set contains the field + if self.source_data_status is None and "source_data_status" in self.model_fields_set: + _dict['sourceDataStatus'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_document_id, sort_order, name, description, document_filed_date, parent_document_id, child_document_id_array, pages, is_preview_available, preview_document, price, in_library, added_to_library_date, download_api, first_fetch_date, source_data_status, *args, **kwargs): # noqa: E501 - """CaseDocument - a model defined in OpenAPI - - Args: - case_document_id (str): UniCourt's Case Document ID. - sort_order (int, none_type): Order of documents how it is being stored in UniCourt. - name (str, none_type): Document name. - description (str, none_type): Description of the document. - document_filed_date (str, none_type): Document Date when it was filed. The document date will be either explicitly provided byt the court or if the document is associatated to a docket entry then the document date will be of docket entry date. - parent_document_id (str, none_type): Document ID which is the parent document for the current document. This will be null if the current document is a parent document. - child_document_id_array ([str, none_type]): List of child document ID's if exists or else it will be an empty lsit. - pages (int, none_type): Total number of pages in the document. - is_preview_available (bool): Determines if a preview is available for the case document. - preview_document (PreviewDocument): - price (float, none_type): Price of the document. - in_library (bool): Determines if the document is present in the UniCourt Library or not. - added_to_library_date (str, none_type): Date and time when the document was downloaded and added to the UniCourt Crowd Source Library. - download_api (str, none_type): Link to either view the document if it is downloaded and already present in the UniCourt CrowdSourced Library. - first_fetch_date (str): Is the date when the document was first fetched from the court site. - source_data_status (str, none_type): The status of source data of document. If the value of sourceDataStatus is SOURCE_DEPRECATED then it means that the Document has been migrated from old court site to a new court site and the data being shown in the API response is from a old court site. If the sourceDataStatus is NO_LONGER_AVAILABLE_IN_COURT then it means that a particular case is invalid in the court site. - - Keyword Args: - object (str): Name of the object. defaults to "CaseDocument" # noqa: E501 - estimated_order_duration (str): Estimated duration of a Order.. defaults to "estimateUnavailable", must be one of ["estimateUnavailable", "withinMinutes", "withinHours", "withinDays", "withinWeeks", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseDocument from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseDocument', + "caseDocumentId": obj.get("caseDocumentId"), + "sortOrder": obj.get("sortOrder"), + "name": obj.get("name"), + "description": obj.get("description"), + "documentFiledDate": obj.get("documentFiledDate"), + "parentDocumentId": obj.get("parentDocumentId"), + "childDocumentIdArray": obj.get("childDocumentIdArray"), + "pages": obj.get("pages"), + "isPreviewAvailable": obj.get("isPreviewAvailable"), + "previewDocument": PreviewDocument.from_dict(obj["previewDocument"]) if obj.get("previewDocument") is not None else None, + "price": obj.get("price"), + "inLibrary": obj.get("inLibrary"), + "addedToLibraryDate": obj.get("addedToLibraryDate"), + "estimatedOrderDuration": obj.get("estimatedOrderDuration") if obj.get("estimatedOrderDuration") is not None else 'estimateUnavailable', + "downloadAPI": obj.get("downloadAPI"), + "firstFetchDate": obj.get("firstFetchDate"), + "sourceDataStatus": obj.get("sourceDataStatus") + }) + return _obj - object = kwargs.get('object', "CaseDocument") - estimated_order_duration = kwargs.get('estimated_order_duration', "estimateUnavailable") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_document_id = case_document_id - self.sort_order = sort_order - self.name = name - self.description = description - self.document_filed_date = document_filed_date - self.parent_document_id = parent_document_id - self.child_document_id_array = child_document_id_array - self.pages = pages - self.is_preview_available = is_preview_available - self.preview_document = preview_document - self.price = price - self.in_library = in_library - self.added_to_library_date = added_to_library_date - self.estimated_order_duration = estimated_order_duration - self.download_api = download_api - self.first_fetch_date = first_fetch_date - self.source_data_status = source_data_status - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_document_id, sort_order, name, description, document_filed_date, parent_document_id, child_document_id_array, pages, is_preview_available, preview_document, price, in_library, added_to_library_date, download_api, first_fetch_date, source_data_status, *args, **kwargs): # noqa: E501 - """CaseDocument - a model defined in OpenAPI - - Args: - case_document_id (str): UniCourt's Case Document ID. - sort_order (int, none_type): Order of documents how it is being stored in UniCourt. - name (str, none_type): Document name. - description (str, none_type): Description of the document. - document_filed_date (str, none_type): Document Date when it was filed. The document date will be either explicitly provided byt the court or if the document is associatated to a docket entry then the document date will be of docket entry date. - parent_document_id (str, none_type): Document ID which is the parent document for the current document. This will be null if the current document is a parent document. - child_document_id_array ([str, none_type]): List of child document ID's if exists or else it will be an empty lsit. - pages (int, none_type): Total number of pages in the document. - is_preview_available (bool): Determines if a preview is available for the case document. - preview_document (PreviewDocument): - price (float, none_type): Price of the document. - in_library (bool): Determines if the document is present in the UniCourt Library or not. - added_to_library_date (str, none_type): Date and time when the document was downloaded and added to the UniCourt Crowd Source Library. - download_api (str, none_type): Link to either view the document if it is downloaded and already present in the UniCourt CrowdSourced Library. - first_fetch_date (str): Is the date when the document was first fetched from the court site. - source_data_status (str, none_type): The status of source data of document. If the value of sourceDataStatus is SOURCE_DEPRECATED then it means that the Document has been migrated from old court site to a new court site and the data being shown in the API response is from a old court site. If the sourceDataStatus is NO_LONGER_AVAILABLE_IN_COURT then it means that a particular case is invalid in the court site. - - Keyword Args: - object (str): Name of the object. defaults to "CaseDocument" # noqa: E501 - estimated_order_duration (str): Estimated duration of a Order.. defaults to "estimateUnavailable", must be one of ["estimateUnavailable", "withinMinutes", "withinHours", "withinDays", "withinWeeks", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - object = kwargs.get('object', "CaseDocument") - estimated_order_duration = kwargs.get('estimated_order_duration', "estimateUnavailable") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_document_id = case_document_id - self.sort_order = sort_order - self.name = name - self.description = description - self.document_filed_date = document_filed_date - self.parent_document_id = parent_document_id - self.child_document_id_array = child_document_id_array - self.pages = pages - self.is_preview_available = is_preview_available - self.preview_document = preview_document - self.price = price - self.in_library = in_library - self.added_to_library_date = added_to_library_date - self.estimated_order_duration = estimated_order_duration - self.download_api = download_api - self.first_fetch_date = first_fetch_date - self.source_data_status = source_data_status - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_document_order_callback.py b/unicourt/model/case_document_order_callback.py index 0b43020..32970cf 100644 --- a/unicourt/model/case_document_order_callback.py +++ b/unicourt/model/case_document_order_callback.py @@ -1,359 +1,132 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_document import CaseDocument - from unicourt.model.exception import Exception - from unicourt.model.export_file import ExportFile - globals()['CaseDocument'] = CaseDocument - globals()['Exception'] = Exception - globals()['ExportFile'] = ExportFile - - -class CaseDocumentOrderCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('status',): { - 'COMPLETE': "COMPLETE", - 'FAILURE': "FAILURE", - 'IN_PROGRESS': "IN_PROGRESS", - 'DELAYED': "DELAYED", - }, - } - - validations = { - ('object',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_document_order_callback_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_document_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('callback_generated_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('status',): { - 'max_length': 11, - 'min_length': 7, - }, - ('case_document_order_callback_api',): { - 'max_length': 1024, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_document_order_callback_id': (str,), # noqa: E501 - 'case_document_id': (str,), # noqa: E501 - 'callback_generated_date': (datetime, none_type,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'case_document': (CaseDocument,), # noqa: E501 - 'case_document_order_callback_api': (str,), # noqa: E501 - 'file': (ExportFile,), # noqa: E501 - 'exception': (Exception,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_document_order_callback_id': 'caseDocumentOrderCallbackId', # noqa: E501 - 'case_document_id': 'caseDocumentId', # noqa: E501 - 'callback_generated_date': 'callbackGeneratedDate', # noqa: E501 - 'status': 'status', # noqa: E501 - 'case_document': 'caseDocument', # noqa: E501 - 'case_document_order_callback_api': 'caseDocumentOrderCallbackAPI', # noqa: E501 - 'file': 'file', # noqa: E501 - 'exception': 'exception', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_document import CaseDocument +from unicourt.model.exception import Exception +from unicourt.model.export_file import ExportFile +from typing import Optional, Set +from typing_extensions import Self + +class CaseDocumentOrderCallback(BaseModel): + """ + CaseDocumentOrderCallback + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default='CaseDocumentOrderCallback', description="Name of the object.") + case_document_order_callback_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Unique Id for the Case Document Order Callback.", alias="caseDocumentOrderCallbackId") + case_document_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="UniCourt's Case Document ID.", alias="caseDocumentId") + callback_generated_date: Optional[datetime] = Field(default=None, description="Date when the job is run.", alias="callbackGeneratedDate") + status: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]] = Field(default=None, description="Status of the request.") + case_document: Optional[CaseDocument] = Field(default=None, alias="caseDocument") + case_document_order_callback_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field(default=None, alias="caseDocumentOrderCallbackAPI") + file: Optional[ExportFile] = None + exception: Optional[Exception] = None + __properties: ClassVar[List[str]] = ["object", "caseDocumentOrderCallbackId", "caseDocumentId", "callbackGeneratedDate", "status", "caseDocument", "caseDocumentOrderCallbackAPI", "file", "exception"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['COMPLETE', 'FAILURE', 'IN_PROGRESS', 'DELAYED']): + raise ValueError("must be one of enum values ('COMPLETE', 'FAILURE', 'IN_PROGRESS', 'DELAYED')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_document_order_callback_id, case_document_id, callback_generated_date, status, case_document, case_document_order_callback_api, file, exception, *args, **kwargs): # noqa: E501 - """CaseDocumentOrderCallback - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseDocumentOrderCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - case_document_order_callback_id (str): Unique Id for the Case Document Order Callback. - case_document_id (str): UniCourt's Case Document ID. - callback_generated_date (datetime, none_type): Date when the job is run. - status (str): Status of the request. - case_document (CaseDocument): - case_document_order_callback_api (str): - file (ExportFile): - exception (Exception): - - Keyword Args: - object (str): Name of the object.. defaults to "CaseDocumentOrderCallback" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "CaseDocumentOrderCallback") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_document_order_callback_id = case_document_order_callback_id - self.case_document_id = case_document_id - self.callback_generated_date = callback_generated_date - self.status = status - self.case_document = case_document - self.case_document_order_callback_api = case_document_order_callback_api - self.file = file - self.exception = exception - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_document_order_callback_id, case_document_id, callback_generated_date, status, case_document, case_document_order_callback_api, file, exception, *args, **kwargs): # noqa: E501 - """CaseDocumentOrderCallback - a model defined in OpenAPI - - Args: - case_document_order_callback_id (str): Unique Id for the Case Document Order Callback. - case_document_id (str): UniCourt's Case Document ID. - callback_generated_date (datetime, none_type): Date when the job is run. - status (str): Status of the request. - case_document (CaseDocument): - case_document_order_callback_api (str): - file (ExportFile): - exception (Exception): - - Keyword Args: - object (str): Name of the object.. defaults to "CaseDocumentOrderCallback" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_document + if self.case_document: + _dict['caseDocument'] = self.case_document.to_dict() + # override the default output from pydantic by calling `to_dict()` of file + if self.file: + _dict['file'] = self.file.to_dict() + # override the default output from pydantic by calling `to_dict()` of exception + if self.exception: + _dict['exception'] = self.exception.to_dict() + # set to None if callback_generated_date (nullable) is None + # and model_fields_set contains the field + if self.callback_generated_date is None and "callback_generated_date" in self.model_fields_set: + _dict['callbackGeneratedDate'] = None + + return _dict - object = kwargs.get('object', "CaseDocumentOrderCallback") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseDocumentOrderCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseDocumentOrderCallback', + "caseDocumentOrderCallbackId": obj.get("caseDocumentOrderCallbackId"), + "caseDocumentId": obj.get("caseDocumentId"), + "callbackGeneratedDate": obj.get("callbackGeneratedDate"), + "status": obj.get("status"), + "caseDocument": CaseDocument.from_dict(obj["caseDocument"]) if obj.get("caseDocument") is not None else None, + "caseDocumentOrderCallbackAPI": obj.get("caseDocumentOrderCallbackAPI"), + "file": ExportFile.from_dict(obj["file"]) if obj.get("file") is not None else None, + "exception": Exception.from_dict(obj["exception"]) if obj.get("exception") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_document_order_callback_id = case_document_order_callback_id - self.case_document_id = case_document_id - self.callback_generated_date = callback_generated_date - self.status = status - self.case_document = case_document - self.case_document_order_callback_api = case_document_order_callback_api - self.file = file - self.exception = exception - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_document_order_callback_list_response.py b/unicourt/model/case_document_order_callback_list_response.py index 2626693..933f2a4 100644 --- a/unicourt/model/case_document_order_callback_list_response.py +++ b/unicourt/model/case_document_order_callback_list_response.py @@ -1,329 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_document_order_callback import CaseDocumentOrderCallback - globals()['CaseDocumentOrderCallback'] = CaseDocumentOrderCallback - - -class CaseDocumentOrderCallbackListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 37, - 'min_length': 37, - }, - ('next_page_api',): { - 'max_length': 1024, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 1024, - 'min_length': 1, - }, - ('callback_array',): { - 'max_items': 100, - 'min_items': 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'callback_array': ([CaseDocumentOrderCallback],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'callback_array': 'callbackArray', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_document_order_callback import CaseDocumentOrderCallback +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseDocumentOrderCallbackListResponse(BaseModel): + """ + CaseDocumentOrderCallbackListResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=37, strict=True, max_length=37)]] = Field(default='CaseDocumentOrderCallbackListResponse', description="Name of the object.") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages available.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of case document order callback objects available.", alias="totalCount") + page_number: Optional[StrictInt] = Field(default=None, description="Current page number.", alias="pageNumber") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field(default=None, description="Link for the next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field(default=None, description="Link for the previous page.", alias="previousPageAPI") + callback_array: Optional[Annotated[List[CaseDocumentOrderCallback], Field(min_length=0, max_length=100)]] = Field(default=None, description="Array of case document order callback objects.", alias="callbackArray") + __properties: ClassVar[List[str]] = ["object", "totalPages", "totalCount", "pageNumber", "nextPageAPI", "previousPageAPI", "callbackArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, total_pages, total_count, page_number, next_page_api, previous_page_api, callback_array, *args, **kwargs): # noqa: E501 - """CaseDocumentOrderCallbackListResponse - a model defined in OpenAPI - - Args: - total_pages (int): Total number of pages available. - total_count (int): Total number of case document order callback objects available. - page_number (int): Current page number. - next_page_api (str, none_type): Link for the next page. - previous_page_api (str, none_type): Link for the previous page. - callback_array ([CaseDocumentOrderCallback]): Array of case document order callback objects. - - Keyword Args: - object (str): Name of the object.. defaults to "CaseDocumentOrderCallbackListResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseDocumentOrderCallbackListResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseDocumentOrderCallbackListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.total_pages = total_pages - self.total_count = total_count - self.page_number = page_number - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.callback_array = callback_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, total_pages, total_count, page_number, next_page_api, previous_page_api, callback_array, *args, **kwargs): # noqa: E501 - """CaseDocumentOrderCallbackListResponse - a model defined in OpenAPI - - Args: - total_pages (int): Total number of pages available. - total_count (int): Total number of case document order callback objects available. - page_number (int): Current page number. - next_page_api (str, none_type): Link for the next page. - previous_page_api (str, none_type): Link for the previous page. - callback_array ([CaseDocumentOrderCallback]): Array of case document order callback objects. - - Keyword Args: - object (str): Name of the object.. defaults to "CaseDocumentOrderCallbackListResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in callback_array (list) + _items = [] + if self.callback_array: + for _item in self.callback_array: + if _item: + _items.append(_item.to_dict()) + _dict['callbackArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseDocumentOrderCallbackListResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseDocumentOrderCallbackListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseDocumentOrderCallbackListResponse', + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount"), + "pageNumber": obj.get("pageNumber"), + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "callbackArray": [CaseDocumentOrderCallback.from_dict(_item) for _item in obj["callbackArray"]] if obj.get("callbackArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.total_pages = total_pages - self.total_count = total_count - self.page_number = page_number - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.callback_array = callback_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_document_order_pacer_options.py b/unicourt/model/case_document_order_pacer_options.py index 0c37126..d2ecee5 100644 --- a/unicourt/model/case_document_order_pacer_options.py +++ b/unicourt/model/case_document_order_pacer_options.py @@ -1,281 +1,105 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CaseDocumentOrderPacerOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseDocumentOrderPacerOptions(BaseModel): """ + **Applicable for PACER cases.** + """ # noqa: E501 + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40)] = Field(description="Your PACER credentials username. This is mandatory when a PACER Case is being requested in the API. For Non PACER cases this is not mandatory. Suppose your request consists of Non PACER and PACER Cases then this needs to be passed becuase you are requesting a PACER case too.", alias="pacerUserId") + pacer_client_code: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]] = Field(default=None, description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)", alias="pacerClientCode") + __properties: ClassVar[List[str]] = ["pacerUserId", "pacerClientCode"] + + @field_validator('pacer_client_code') + def pacer_client_code_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9._\-\/]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9._\-\/]+$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('pacer_user_id',): { - 'max_length': 40, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseDocumentOrderPacerOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'pacer_user_id': (str,), # noqa: E501 - 'pacer_client_code': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if pacer_client_code (nullable) is None + # and model_fields_set contains the field + if self.pacer_client_code is None and "pacer_client_code" in self.model_fields_set: + _dict['pacerClientCode'] = None - attribute_map = { - 'pacer_user_id': 'pacerUserId', # noqa: E501 - 'pacer_client_code': 'pacerClientCode', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pacer_user_id, *args, **kwargs): # noqa: E501 - """CaseDocumentOrderPacerOptions - a model defined in OpenAPI - - Args: - pacer_user_id (str): Your PACER credentials username. This is mandatory when a PACER Case is being requested in the API. For Non PACER cases this is not mandatory. Suppose your request consists of Non PACER and PACER Cases then this needs to be passed becuase you are requesting a PACER case too. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - pacer_client_code (str, none_type): PACER Client Code. This is mandatory if your setting in PACER website is set to True for required client code.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.pacer_user_id = pacer_user_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, pacer_user_id, *args, **kwargs): # noqa: E501 - """CaseDocumentOrderPacerOptions - a model defined in OpenAPI - - Args: - pacer_user_id (str): Your PACER credentials username. This is mandatory when a PACER Case is being requested in the API. For Non PACER cases this is not mandatory. Suppose your request consists of Non PACER and PACER Cases then this needs to be passed becuase you are requesting a PACER case too. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - pacer_client_code (str, none_type): PACER Client Code. This is mandatory if your setting in PACER website is set to True for required client code.. [optional] # noqa: E501 - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseDocumentOrderPacerOptions from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "pacerUserId": obj.get("pacerUserId"), + "pacerClientCode": obj.get("pacerClientCode") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.pacer_user_id = pacer_user_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_document_order_request.py b/unicourt/model/case_document_order_request.py index e32f397..7f37fc4 100644 --- a/unicourt/model/case_document_order_request.py +++ b/unicourt/model/case_document_order_request.py @@ -1,289 +1,96 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_document_order_pacer_options import CaseDocumentOrderPacerOptions - globals()['CaseDocumentOrderPacerOptions'] = CaseDocumentOrderPacerOptions - - -class CaseDocumentOrderRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('case_document_id',): { - 'max_length': 18, - 'min_length': 18, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'case_document_id': (str,), # noqa: E501 - 'is_preview_only': (bool,), # noqa: E501 - 'pacer_options': (CaseDocumentOrderPacerOptions,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_document_order_pacer_options import CaseDocumentOrderPacerOptions +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class CaseDocumentOrderRequest(BaseModel): + """ + CaseDocumentOrderRequest + """ # noqa: E501 + case_document_id: Annotated[str, Field(min_length=18, strict=True, max_length=18)] = Field(description="Document ID which you want to order.", alias="caseDocumentId") + is_preview_only: StrictBool = Field(description="Flag value to determine if the document order is a preview order or no.", alias="isPreviewOnly") + pacer_options: Optional[CaseDocumentOrderPacerOptions] = Field(default=None, alias="pacerOptions") + __properties: ClassVar[List[str]] = ["caseDocumentId", "isPreviewOnly", "pacerOptions"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'case_document_id': 'caseDocumentId', # noqa: E501 - 'is_preview_only': 'isPreviewOnly', # noqa: E501 - 'pacer_options': 'pacerOptions', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_document_id, is_preview_only, *args, **kwargs): # noqa: E501 - """CaseDocumentOrderRequest - a model defined in OpenAPI - - Args: - case_document_id (str): Document ID which you want to order. - is_preview_only (bool): Flag value to determine if the document order is a preview order or no. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - pacer_options (CaseDocumentOrderPacerOptions): [optional] # noqa: E501 - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseDocumentOrderRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.case_document_id = case_document_id - self.is_preview_only = is_preview_only - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_document_id, is_preview_only, *args, **kwargs): # noqa: E501 - """CaseDocumentOrderRequest - a model defined in OpenAPI - - Args: - case_document_id (str): Document ID which you want to order. - is_preview_only (bool): Flag value to determine if the document order is a preview order or no. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - pacer_options (CaseDocumentOrderPacerOptions): [optional] # noqa: E501 + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pacer_options + if self.pacer_options: + _dict['pacerOptions'] = self.pacer_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseDocumentOrderRequest from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "caseDocumentId": obj.get("caseDocumentId"), + "isPreviewOnly": obj.get("isPreviewOnly"), + "pacerOptions": CaseDocumentOrderPacerOptions.from_dict(obj["pacerOptions"]) if obj.get("pacerOptions") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.case_document_id = case_document_id - self.is_preview_only = is_preview_only - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_documents.py b/unicourt/model/case_documents.py index b37e78b..ab82b53 100644 --- a/unicourt/model/case_documents.py +++ b/unicourt/model/case_documents.py @@ -1,317 +1,111 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.case_document import CaseDocument - globals()['CaseDocument'] = CaseDocument +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class CaseDocuments(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_document import CaseDocument +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseDocuments(BaseModel): """ + CaseDocuments + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=13, strict=True, max_length=13)]] = Field(default='CaseDocuments', description="Name of the object") + page_number: Optional[StrictInt] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + case_document_array: Optional[Annotated[List[CaseDocument], Field(max_length=100)]] = Field(default=None, alias="caseDocumentArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to next page of a particular entity in a Case.", alias="nextPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects of a party in the Case.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of parties of the Case entity in a Case.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "pageNumber", "caseDocumentArray", "nextPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 13, - 'min_length': 13, - }, - ('case_document_array',): { - 'max_items': 100, - }, - ('next_page_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseDocuments from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'case_document_array': ([CaseDocument],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'case_document_array': 'caseDocumentArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in case_document_array (list) + _items = [] + if self.case_document_array: + for _item in self.case_document_array: + if _item: + _items.append(_item.to_dict()) + _dict['caseDocumentArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, page_number, case_document_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseDocuments - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - case_document_array ([CaseDocument]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "CaseDocuments" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseDocuments") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.page_number = page_number - self.case_document_array = case_document_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, page_number, case_document_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseDocuments - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - case_document_array ([CaseDocument]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "CaseDocuments" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseDocuments from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseDocuments") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseDocuments', + "pageNumber": obj.get("pageNumber"), + "caseDocumentArray": [CaseDocument.from_dict(_item) for _item in obj["caseDocumentArray"]] if obj.get("caseDocumentArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.page_number = page_number - self.case_document_array = case_document_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_export_callback.py b/unicourt/model/case_export_callback.py index 820842f..a35c036 100644 --- a/unicourt/model/case_export_callback.py +++ b/unicourt/model/case_export_callback.py @@ -1,350 +1,126 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.exception import Exception - from unicourt.model.export_file import ExportFile - globals()['Exception'] = Exception - globals()['ExportFile'] = ExportFile - - -class CaseExportCallback(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('status',): { - 'COMPLETE': "COMPLETE", - 'FAILURE': "FAILURE", - 'IN_PROGRESS': "IN_PROGRESS", - }, - } - - validations = { - ('object',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_export_callback_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('callback_generated_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('status',): { - 'max_length': 11, - 'min_length': 7, - }, - ('case_export_callback_api',): { - 'max_length': 1024, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_export_callback_id': (str,), # noqa: E501 - 'case_id': (str,), # noqa: E501 - 'callback_generated_date': (datetime, none_type,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'case_export_callback_api': (str,), # noqa: E501 - 'file': (ExportFile,), # noqa: E501 - 'exception': (Exception,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_export_callback_id': 'caseExportCallbackId', # noqa: E501 - 'case_id': 'caseId', # noqa: E501 - 'callback_generated_date': 'callbackGeneratedDate', # noqa: E501 - 'status': 'status', # noqa: E501 - 'case_export_callback_api': 'caseExportCallbackAPI', # noqa: E501 - 'file': 'file', # noqa: E501 - 'exception': 'exception', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.exception import Exception +from unicourt.model.export_file import ExportFile +from typing import Optional, Set +from typing_extensions import Self + +class CaseExportCallback(BaseModel): + """ + CaseExportCallback + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default='CaseExportCallback', description="Name of the object.") + case_export_callback_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Unique Id for the Case Export Callback.", alias="caseExportCallbackId") + case_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Unique Id for a Case in UniCourt.", alias="caseId") + callback_generated_date: Optional[datetime] = Field(default=None, description="Date when the job is run.", alias="callbackGeneratedDate") + status: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]] = Field(default=None, description="Status of the request.") + case_export_callback_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field(default=None, alias="caseExportCallbackAPI") + file: Optional[ExportFile] = None + exception: Optional[Exception] = None + __properties: ClassVar[List[str]] = ["object", "caseExportCallbackId", "caseId", "callbackGeneratedDate", "status", "caseExportCallbackAPI", "file", "exception"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['COMPLETE', 'FAILURE', 'IN_PROGRESS']): + raise ValueError("must be one of enum values ('COMPLETE', 'FAILURE', 'IN_PROGRESS')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_export_callback_id, case_id, callback_generated_date, status, case_export_callback_api, file, exception, *args, **kwargs): # noqa: E501 - """CaseExportCallback - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseExportCallback from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - case_export_callback_id (str): Unique Id for the Case Export Callback. - case_id (str): Unique Id for a Case in UniCourt. - callback_generated_date (datetime, none_type): Date when the job is run. - status (str): Status of the request. - case_export_callback_api (str): - file (ExportFile): - exception (Exception): - - Keyword Args: - object (str): Name of the object.. defaults to "CaseExportCallback" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "CaseExportCallback") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_export_callback_id = case_export_callback_id - self.case_id = case_id - self.callback_generated_date = callback_generated_date - self.status = status - self.case_export_callback_api = case_export_callback_api - self.file = file - self.exception = exception - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_export_callback_id, case_id, callback_generated_date, status, case_export_callback_api, file, exception, *args, **kwargs): # noqa: E501 - """CaseExportCallback - a model defined in OpenAPI - - Args: - case_export_callback_id (str): Unique Id for the Case Export Callback. - case_id (str): Unique Id for a Case in UniCourt. - callback_generated_date (datetime, none_type): Date when the job is run. - status (str): Status of the request. - case_export_callback_api (str): - file (ExportFile): - exception (Exception): - - Keyword Args: - object (str): Name of the object.. defaults to "CaseExportCallback" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of file + if self.file: + _dict['file'] = self.file.to_dict() + # override the default output from pydantic by calling `to_dict()` of exception + if self.exception: + _dict['exception'] = self.exception.to_dict() + # set to None if callback_generated_date (nullable) is None + # and model_fields_set contains the field + if self.callback_generated_date is None and "callback_generated_date" in self.model_fields_set: + _dict['callbackGeneratedDate'] = None + + return _dict - object = kwargs.get('object', "CaseExportCallback") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseExportCallback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseExportCallback', + "caseExportCallbackId": obj.get("caseExportCallbackId"), + "caseId": obj.get("caseId"), + "callbackGeneratedDate": obj.get("callbackGeneratedDate"), + "status": obj.get("status"), + "caseExportCallbackAPI": obj.get("caseExportCallbackAPI"), + "file": ExportFile.from_dict(obj["file"]) if obj.get("file") is not None else None, + "exception": Exception.from_dict(obj["exception"]) if obj.get("exception") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_export_callback_id = case_export_callback_id - self.case_id = case_id - self.callback_generated_date = callback_generated_date - self.status = status - self.case_export_callback_api = case_export_callback_api - self.file = file - self.exception = exception - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_export_callback_list_response.py b/unicourt/model/case_export_callback_list_response.py index 983b213..fa23a96 100644 --- a/unicourt/model/case_export_callback_list_response.py +++ b/unicourt/model/case_export_callback_list_response.py @@ -1,329 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_export_callback import CaseExportCallback - globals()['CaseExportCallback'] = CaseExportCallback - - -class CaseExportCallbackListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 30, - 'min_length': 30, - }, - ('next_page_api',): { - 'max_length': 1024, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 1024, - 'min_length': 1, - }, - ('callback_array',): { - 'max_items': 100, - 'min_items': 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'callback_array': ([CaseExportCallback],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'callback_array': 'callbackArray', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_export_callback import CaseExportCallback +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseExportCallbackListResponse(BaseModel): + """ + CaseExportCallbackListResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=30, strict=True, max_length=30)]] = Field(default='CaseExportCallbackListResponse', description="Name of the object.") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages available.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of case export callback objects available.", alias="totalCount") + page_number: Optional[StrictInt] = Field(default=None, description="Current page number.", alias="pageNumber") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field(default=None, description="Link for the next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field(default=None, description="Link for the previous page.", alias="previousPageAPI") + callback_array: Optional[Annotated[List[CaseExportCallback], Field(min_length=0, max_length=100)]] = Field(default=None, description="Array of case export callback objects.", alias="callbackArray") + __properties: ClassVar[List[str]] = ["object", "totalPages", "totalCount", "pageNumber", "nextPageAPI", "previousPageAPI", "callbackArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, total_pages, total_count, page_number, next_page_api, previous_page_api, callback_array, *args, **kwargs): # noqa: E501 - """CaseExportCallbackListResponse - a model defined in OpenAPI - - Args: - total_pages (int): Total number of pages available. - total_count (int): Total number of case export callback objects available. - page_number (int): Current page number. - next_page_api (str, none_type): Link for the next page. - previous_page_api (str, none_type): Link for the previous page. - callback_array ([CaseExportCallback]): Array of case export callback objects. - - Keyword Args: - object (str): Name of the object.. defaults to "CaseExportCallbackListResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseExportCallbackListResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseExportCallbackListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.total_pages = total_pages - self.total_count = total_count - self.page_number = page_number - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.callback_array = callback_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, total_pages, total_count, page_number, next_page_api, previous_page_api, callback_array, *args, **kwargs): # noqa: E501 - """CaseExportCallbackListResponse - a model defined in OpenAPI - - Args: - total_pages (int): Total number of pages available. - total_count (int): Total number of case export callback objects available. - page_number (int): Current page number. - next_page_api (str, none_type): Link for the next page. - previous_page_api (str, none_type): Link for the previous page. - callback_array ([CaseExportCallback]): Array of case export callback objects. - - Keyword Args: - object (str): Name of the object.. defaults to "CaseExportCallbackListResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in callback_array (list) + _items = [] + if self.callback_array: + for _item in self.callback_array: + if _item: + _items.append(_item.to_dict()) + _dict['callbackArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseExportCallbackListResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseExportCallbackListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseExportCallbackListResponse', + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount"), + "pageNumber": obj.get("pageNumber"), + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "callbackArray": [CaseExportCallback.from_dict(_item) for _item in obj["callbackArray"]] if obj.get("callbackArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.total_pages = total_pages - self.total_count = total_count - self.page_number = page_number - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.callback_array = callback_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_relationship_type.py b/unicourt/model/case_relationship_type.py index 043abfe..d42bb24 100644 --- a/unicourt/model/case_relationship_type.py +++ b/unicourt/model/case_relationship_type.py @@ -1,305 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CaseRelationshipType(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseRelationshipType(BaseModel): """ + CaseRelationshipType + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=20, strict=True, max_length=20)]] = 'CaseRelationshipType' + case_relationship_type_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="caseRelationshipTypeId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "caseRelationshipTypeId", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 20, - 'min_length': 20, - }, - ('case_relationship_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseRelationshipType from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'case_relationship_type_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_relationship_type_id': 'caseRelationshipTypeId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_relationship_type_id, name, created_date, *args, **kwargs): # noqa: E501 - """CaseRelationshipType - a model defined in OpenAPI - - Args: - case_relationship_type_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CaseRelationshipType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseRelationshipType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_relationship_type_id = case_relationship_type_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_relationship_type_id, name, created_date, *args, **kwargs): # noqa: E501 - """CaseRelationshipType - a model defined in OpenAPI - - Args: - case_relationship_type_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CaseRelationshipType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseRelationshipType from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseRelationshipType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseRelationshipType', + "caseRelationshipTypeId": obj.get("caseRelationshipTypeId"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_relationship_type_id = case_relationship_type_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_relationship_type_response.py b/unicourt/model/case_relationship_type_response.py index b383a4f..856558f 100644 --- a/unicourt/model/case_relationship_type_response.py +++ b/unicourt/model/case_relationship_type_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_relationship_type import CaseRelationshipType - globals()['CaseRelationshipType'] = CaseRelationshipType - - -class CaseRelationshipTypeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 28, - 'min_length': 28, - }, - ('case_relationship_type_array',): { - }, - ('next_page_api',): { - 'max_length': 2153, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2152, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_relationship_type_array': ([CaseRelationshipType],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_relationship_type_array': 'caseRelationshipTypeArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_relationship_type import CaseRelationshipType +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseRelationshipTypeResponse(BaseModel): + """ + CaseRelationshipTypeResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=28, strict=True, max_length=28)]] = 'CaseRelationshipTypeResponse' + case_relationship_type_array: Optional[List[CaseRelationshipType]] = Field(default=None, alias="caseRelationshipTypeArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2153)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2152)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "caseRelationshipTypeArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_relationship_type_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseRelationshipTypeResponse - a model defined in OpenAPI - - Args: - case_relationship_type_array ([CaseRelationshipType]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CaseRelationshipTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseRelationshipTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseRelationshipTypeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.case_relationship_type_array = case_relationship_type_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, case_relationship_type_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseRelationshipTypeResponse - a model defined in OpenAPI - - Args: - case_relationship_type_array ([CaseRelationshipType]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CaseRelationshipTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in case_relationship_type_array (list) + _items = [] + if self.case_relationship_type_array: + for _item in self.case_relationship_type_array: + if _item: + _items.append(_item.to_dict()) + _dict['caseRelationshipTypeArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseRelationshipTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseRelationshipTypeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseRelationshipTypeResponse', + "caseRelationshipTypeArray": [CaseRelationshipType.from_dict(_item) for _item in obj["caseRelationshipTypeArray"]] if obj.get("caseRelationshipTypeArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_relationship_type_array = case_relationship_type_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_search_response.py b/unicourt/model/case_search_response.py index 9955e13..c86fe58 100644 --- a/unicourt/model/case_search_response.py +++ b/unicourt/model/case_search_response.py @@ -1,353 +1,122 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_search_result import CaseSearchResult - globals()['CaseSearchResult'] = CaseSearchResult - - -class CaseSearchResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_search_result_array',): { - }, - ('q',): { - 'max_length': 2048, - 'min_length': 3, - }, - ('case_search_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('next_page_api',): { - 'max_length': 2138, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2138, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_search_result_array': ([CaseSearchResult],), # noqa: E501 - 'q': (str,), # noqa: E501 - 'case_search_id': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_search_result_array': 'caseSearchResultArray', # noqa: E501 - 'q': 'q', # noqa: E501 - 'case_search_id': 'caseSearchId', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_search_result import CaseSearchResult +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseSearchResponse(BaseModel): + """ + CaseSearchResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = 'CaseSearchResponse' + case_search_result_array: Optional[List[CaseSearchResult]] = Field(default=None, alias="caseSearchResultArray") + q: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2048)]] = Field(default=None, description="Query been sent by client") + case_search_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Query been sent by client", alias="caseSearchId") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2138)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2138)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total pages for matches that were found in the index.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="The number of matches that were found in the index.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "caseSearchResultArray", "q", "caseSearchId", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_search_result_array, q, case_search_id, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseSearchResponse - a model defined in OpenAPI - - Args: - case_search_result_array ([CaseSearchResult]): - q (str): Query been sent by client - case_search_id (str): Query been sent by client - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): - total_pages (int): Total pages for matches that were found in the index. - total_count (int): The number of matches that were found in the index. - - Keyword Args: - object (str): defaults to "CaseSearchResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseSearchResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseSearchResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.case_search_result_array = case_search_result_array - self.q = q - self.case_search_id = case_search_id - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, case_search_result_array, q, case_search_id, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseSearchResponse - a model defined in OpenAPI - - Args: - case_search_result_array ([CaseSearchResult]): - q (str): Query been sent by client - case_search_id (str): Query been sent by client - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): - total_pages (int): Total pages for matches that were found in the index. - total_count (int): The number of matches that were found in the index. - - Keyword Args: - object (str): defaults to "CaseSearchResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in case_search_result_array (list) + _items = [] + if self.case_search_result_array: + for _item in self.case_search_result_array: + if _item: + _items.append(_item.to_dict()) + _dict['caseSearchResultArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseSearchResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseSearchResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseSearchResponse', + "caseSearchResultArray": [CaseSearchResult.from_dict(_item) for _item in obj["caseSearchResultArray"]] if obj.get("caseSearchResultArray") is not None else None, + "q": obj.get("q"), + "caseSearchId": obj.get("caseSearchId"), + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_search_result_array = case_search_result_array - self.q = q - self.case_search_id = case_search_id - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_search_result.py b/unicourt/model/case_search_result.py index 0da9637..16b93e3 100644 --- a/unicourt/model/case_search_result.py +++ b/unicourt/model/case_search_result.py @@ -1,408 +1,151 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_status import CaseStatus - from unicourt.model.case_type import CaseType - from unicourt.model.court import Court - from unicourt.model.court_location import CourtLocation - from unicourt.model.matched_object import MatchedObject - globals()['CaseStatus'] = CaseStatus - globals()['CaseType'] = CaseType - globals()['Court'] = Court - globals()['CourtLocation'] = CourtLocation - globals()['MatchedObject'] = MatchedObject - - -class CaseSearchResult(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 16, - 'min_length': 16, - }, - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_name',): { - 'max_length': 250, - }, - ('case_number',): { - 'max_length': 255, - 'min_length': 1, - }, - ('filed_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date_with_updates',): { - 'max_length': 25, - 'min_length': 25, - }, - ('participants_last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_api',): { - 'max_length': 255, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_id': (str,), # noqa: E501 - 'case_name': (str, none_type,), # noqa: E501 - 'case_number': (str,), # noqa: E501 - 'filed_date': (datetime,), # noqa: E501 - 'court': (Court,), # noqa: E501 - 'court_location': (CourtLocation,), # noqa: E501 - 'case_type': (CaseType,), # noqa: E501 - 'case_status': (CaseStatus,), # noqa: E501 - 'first_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date_with_updates': (datetime,), # noqa: E501 - 'participants_last_fetch_date': (datetime, none_type,), # noqa: E501 - 'case_api': (str,), # noqa: E501 - 'matched_object_array': ([MatchedObject],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_id': 'caseId', # noqa: E501 - 'case_name': 'caseName', # noqa: E501 - 'case_number': 'caseNumber', # noqa: E501 - 'filed_date': 'filedDate', # noqa: E501 - 'court': 'court', # noqa: E501 - 'court_location': 'courtLocation', # noqa: E501 - 'case_type': 'caseType', # noqa: E501 - 'case_status': 'caseStatus', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'last_fetch_date_with_updates': 'lastFetchDateWithUpdates', # noqa: E501 - 'participants_last_fetch_date': 'participantsLastFetchDate', # noqa: E501 - 'case_api': 'caseAPI', # noqa: E501 - 'matched_object_array': 'matchedObjectArray', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_status import CaseStatus +from unicourt.model.case_type import CaseType +from unicourt.model.court import Court +from unicourt.model.court_location import CourtLocation +from unicourt.model.matched_object import MatchedObject +from typing import Optional, Set +from typing_extensions import Self + +class CaseSearchResult(BaseModel): + """ + CaseSearchResult + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=16, strict=True, max_length=16)]] = 'CaseSearchResult' + case_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="caseId") + case_name: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="caseName") + case_number: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="caseNumber") + filed_date: Optional[datetime] = Field(default=None, alias="filedDate") + court: Optional[Court] = None + court_location: Optional[CourtLocation] = Field(default=None, alias="courtLocation") + case_type: Optional[CaseType] = Field(default=None, alias="caseType") + case_status: Optional[CaseStatus] = Field(default=None, alias="caseStatus") + first_fetch_date: Optional[datetime] = Field(default=None, alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, alias="lastFetchDate") + last_fetch_date_with_updates: Optional[datetime] = Field(default=None, alias="lastFetchDateWithUpdates") + participants_last_fetch_date: Optional[datetime] = Field(default=None, alias="participantsLastFetchDate") + case_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="caseAPI") + matched_object_array: Optional[List[MatchedObject]] = Field(default=None, alias="matchedObjectArray") + __properties: ClassVar[List[str]] = ["object", "caseId", "caseName", "caseNumber", "filedDate", "court", "courtLocation", "caseType", "caseStatus", "firstFetchDate", "lastFetchDate", "lastFetchDateWithUpdates", "participantsLastFetchDate", "caseAPI", "matchedObjectArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_id, case_name, case_number, filed_date, court, court_location, case_type, case_status, first_fetch_date, last_fetch_date, last_fetch_date_with_updates, participants_last_fetch_date, case_api, matched_object_array, *args, **kwargs): # noqa: E501 - """CaseSearchResult - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseSearchResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - case_id (str): - case_name (str, none_type): - case_number (str): - filed_date (datetime): - court (Court): - court_location (CourtLocation): - case_type (CaseType): - case_status (CaseStatus): - first_fetch_date (datetime): - last_fetch_date (datetime): - last_fetch_date_with_updates (datetime): - participants_last_fetch_date (datetime, none_type): - case_api (str): - matched_object_array ([MatchedObject]): - - Keyword Args: - object (str): defaults to "CaseSearchResult" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "CaseSearchResult") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_id = case_id - self.case_name = case_name - self.case_number = case_number - self.filed_date = filed_date - self.court = court - self.court_location = court_location - self.case_type = case_type - self.case_status = case_status - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.last_fetch_date_with_updates = last_fetch_date_with_updates - self.participants_last_fetch_date = participants_last_fetch_date - self.case_api = case_api - self.matched_object_array = matched_object_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_id, case_name, case_number, filed_date, court, court_location, case_type, case_status, first_fetch_date, last_fetch_date, last_fetch_date_with_updates, participants_last_fetch_date, case_api, matched_object_array, *args, **kwargs): # noqa: E501 - """CaseSearchResult - a model defined in OpenAPI - - Args: - case_id (str): - case_name (str, none_type): - case_number (str): - filed_date (datetime): - court (Court): - court_location (CourtLocation): - case_type (CaseType): - case_status (CaseStatus): - first_fetch_date (datetime): - last_fetch_date (datetime): - last_fetch_date_with_updates (datetime): - participants_last_fetch_date (datetime, none_type): - case_api (str): - matched_object_array ([MatchedObject]): - - Keyword Args: - object (str): defaults to "CaseSearchResult" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of court + if self.court: + _dict['court'] = self.court.to_dict() + # override the default output from pydantic by calling `to_dict()` of court_location + if self.court_location: + _dict['courtLocation'] = self.court_location.to_dict() + # override the default output from pydantic by calling `to_dict()` of case_type + if self.case_type: + _dict['caseType'] = self.case_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of case_status + if self.case_status: + _dict['caseStatus'] = self.case_status.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in matched_object_array (list) + _items = [] + if self.matched_object_array: + for _item in self.matched_object_array: + if _item: + _items.append(_item.to_dict()) + _dict['matchedObjectArray'] = _items + # set to None if case_name (nullable) is None + # and model_fields_set contains the field + if self.case_name is None and "case_name" in self.model_fields_set: + _dict['caseName'] = None + + # set to None if participants_last_fetch_date (nullable) is None + # and model_fields_set contains the field + if self.participants_last_fetch_date is None and "participants_last_fetch_date" in self.model_fields_set: + _dict['participantsLastFetchDate'] = None + + return _dict - object = kwargs.get('object', "CaseSearchResult") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseSearchResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseSearchResult', + "caseId": obj.get("caseId"), + "caseName": obj.get("caseName"), + "caseNumber": obj.get("caseNumber"), + "filedDate": obj.get("filedDate"), + "court": Court.from_dict(obj["court"]) if obj.get("court") is not None else None, + "courtLocation": CourtLocation.from_dict(obj["courtLocation"]) if obj.get("courtLocation") is not None else None, + "caseType": CaseType.from_dict(obj["caseType"]) if obj.get("caseType") is not None else None, + "caseStatus": CaseStatus.from_dict(obj["caseStatus"]) if obj.get("caseStatus") is not None else None, + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate"), + "lastFetchDateWithUpdates": obj.get("lastFetchDateWithUpdates"), + "participantsLastFetchDate": obj.get("participantsLastFetchDate"), + "caseAPI": obj.get("caseAPI"), + "matchedObjectArray": [MatchedObject.from_dict(_item) for _item in obj["matchedObjectArray"]] if obj.get("matchedObjectArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_id = case_id - self.case_name = case_name - self.case_number = case_number - self.filed_date = filed_date - self.court = court - self.court_location = court_location - self.case_type = case_type - self.case_status = case_status - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.last_fetch_date_with_updates = last_fetch_date_with_updates - self.participants_last_fetch_date = participants_last_fetch_date - self.case_api = case_api - self.matched_object_array = matched_object_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_stats.py b/unicourt/model/case_stats.py index 8dd4650..b99606b 100644 --- a/unicourt/model/case_stats.py +++ b/unicourt/model/case_stats.py @@ -1,335 +1,108 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class CaseStats(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 9, - 'min_length': 9, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'party_count': (int,), # noqa: E501 - 'attorney_count': (int,), # noqa: E501 - 'judge_count': (int,), # noqa: E501 - 'docket_entry_count': (int,), # noqa: E501 - 'free_case_document_count': (int,), # noqa: E501 - 'paid_case_document_count': (int,), # noqa: E501 - 'all_case_document_count': (int,), # noqa: E501 - 'case_document_in_library_count': (int,), # noqa: E501 - 'hearing_count': (int,), # noqa: E501 - 'related_case_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'party_count': 'partyCount', # noqa: E501 - 'attorney_count': 'attorneyCount', # noqa: E501 - 'judge_count': 'judgeCount', # noqa: E501 - 'docket_entry_count': 'docketEntryCount', # noqa: E501 - 'free_case_document_count': 'freeCaseDocumentCount', # noqa: E501 - 'paid_case_document_count': 'paidCaseDocumentCount', # noqa: E501 - 'all_case_document_count': 'allCaseDocumentCount', # noqa: E501 - 'case_document_in_library_count': 'caseDocumentInLibraryCount', # noqa: E501 - 'hearing_count': 'hearingCount', # noqa: E501 - 'related_case_count': 'relatedCaseCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseStats(BaseModel): + """ + Count of each entitiy of a case is mentioned here so that you can calculate the number of requests needs to be done to obtain each entity results completely. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]] = Field(default='CaseStats', description="Name of the object") + party_count: Optional[StrictInt] = Field(default=None, description="Count of number of parties available in the case being requested for.", alias="partyCount") + attorney_count: Optional[StrictInt] = Field(default=None, description="Count of number of attornies available in the case being requested for.", alias="attorneyCount") + judge_count: Optional[StrictInt] = Field(default=None, description="Count of number of judges available in the case being requested for.", alias="judgeCount") + docket_entry_count: Optional[StrictInt] = Field(default=None, description="Count of number of docket entries available in the case being requested for.", alias="docketEntryCount") + free_case_document_count: Optional[StrictInt] = Field(default=None, description="Count of number of free documents available in the case being requested for.", alias="freeCaseDocumentCount") + paid_case_document_count: Optional[StrictInt] = Field(default=None, description="Count of number of paid documents available in the case being requested for.", alias="paidCaseDocumentCount") + all_case_document_count: Optional[StrictInt] = Field(default=None, description="Count which includes the freeCaseDocumentCount and paidCaseDocumentCount.", alias="allCaseDocumentCount") + case_document_in_library_count: Optional[StrictInt] = Field(default=None, description="Count of number of documents that are available in the UniCourt CrowdSourced Library for the case being requested for.", alias="caseDocumentInLibraryCount") + hearing_count: Optional[StrictInt] = Field(default=None, description="Count of number of hearings available in the case being requested for.", alias="hearingCount") + related_case_count: Optional[StrictInt] = Field(default=None, description="Count of related cases that are available in the case being requested.", alias="relatedCaseCount") + __properties: ClassVar[List[str]] = ["object", "partyCount", "attorneyCount", "judgeCount", "docketEntryCount", "freeCaseDocumentCount", "paidCaseDocumentCount", "allCaseDocumentCount", "caseDocumentInLibraryCount", "hearingCount", "relatedCaseCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, party_count, attorney_count, judge_count, docket_entry_count, free_case_document_count, paid_case_document_count, all_case_document_count, case_document_in_library_count, hearing_count, related_case_count, *args, **kwargs): # noqa: E501 - """CaseStats - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseStats from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - party_count (int): Count of number of parties available in the case being requested for. - attorney_count (int): Count of number of attornies available in the case being requested for. - judge_count (int): Count of number of judges available in the case being requested for. - docket_entry_count (int): Count of number of docket entries available in the case being requested for. - free_case_document_count (int): Count of number of free documents available in the case being requested for. - paid_case_document_count (int): Count of number of paid documents available in the case being requested for. - all_case_document_count (int): Count which includes the freeCaseDocumentCount and paidCaseDocumentCount. - case_document_in_library_count (int): Count of number of documents that are available in the UniCourt CrowdSourced Library for the case being requested for. - hearing_count (int): Count of number of hearings available in the case being requested for. - related_case_count (int): Count of related cases that are available in the case being requested. - - Keyword Args: - object (str): Name of the object. defaults to "CaseStats" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "CaseStats") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.party_count = party_count - self.attorney_count = attorney_count - self.judge_count = judge_count - self.docket_entry_count = docket_entry_count - self.free_case_document_count = free_case_document_count - self.paid_case_document_count = paid_case_document_count - self.all_case_document_count = all_case_document_count - self.case_document_in_library_count = case_document_in_library_count - self.hearing_count = hearing_count - self.related_case_count = related_case_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, party_count, attorney_count, judge_count, docket_entry_count, free_case_document_count, paid_case_document_count, all_case_document_count, case_document_in_library_count, hearing_count, related_case_count, *args, **kwargs): # noqa: E501 - """CaseStats - a model defined in OpenAPI - - Args: - party_count (int): Count of number of parties available in the case being requested for. - attorney_count (int): Count of number of attornies available in the case being requested for. - judge_count (int): Count of number of judges available in the case being requested for. - docket_entry_count (int): Count of number of docket entries available in the case being requested for. - free_case_document_count (int): Count of number of free documents available in the case being requested for. - paid_case_document_count (int): Count of number of paid documents available in the case being requested for. - all_case_document_count (int): Count which includes the freeCaseDocumentCount and paidCaseDocumentCount. - case_document_in_library_count (int): Count of number of documents that are available in the UniCourt CrowdSourced Library for the case being requested for. - hearing_count (int): Count of number of hearings available in the case being requested for. - related_case_count (int): Count of related cases that are available in the case being requested. - - Keyword Args: - object (str): Name of the object. defaults to "CaseStats" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) - object = kwargs.get('object', "CaseStats") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseStats from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseStats', + "partyCount": obj.get("partyCount"), + "attorneyCount": obj.get("attorneyCount"), + "judgeCount": obj.get("judgeCount"), + "docketEntryCount": obj.get("docketEntryCount"), + "freeCaseDocumentCount": obj.get("freeCaseDocumentCount"), + "paidCaseDocumentCount": obj.get("paidCaseDocumentCount"), + "allCaseDocumentCount": obj.get("allCaseDocumentCount"), + "caseDocumentInLibraryCount": obj.get("caseDocumentInLibraryCount"), + "hearingCount": obj.get("hearingCount"), + "relatedCaseCount": obj.get("relatedCaseCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.party_count = party_count - self.attorney_count = attorney_count - self.judge_count = judge_count - self.docket_entry_count = docket_entry_count - self.free_case_document_count = free_case_document_count - self.paid_case_document_count = paid_case_document_count - self.all_case_document_count = all_case_document_count - self.case_document_in_library_count = case_document_in_library_count - self.hearing_count = hearing_count - self.related_case_count = related_case_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_status.py b/unicourt/model/case_status.py index 4e8c362..060f21b 100644 --- a/unicourt/model/case_status.py +++ b/unicourt/model/case_status.py @@ -1,331 +1,106 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CaseStatus(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseStatus(BaseModel): """ + CaseStatus + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=10, strict=True, max_length=10)]] = 'CaseStatus' + case_status_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="caseStatusId") + case_status_group_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="caseStatusGroupId") + case_status_group: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="caseStatusGroup") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + case_class_array: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=255)]]] = Field(default=None, alias="caseClassArray") + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "caseStatusId", "caseStatusGroupId", "caseStatusGroup", "name", "caseClassArray", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 10, - 'min_length': 10, - }, - ('case_status_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_status_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_status_group',): { - 'max_length': 255, - 'min_length': 1, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'case_status_id': (str,), # noqa: E501 - 'case_status_group_id': (str,), # noqa: E501 - 'case_status_group': (str,), # noqa: E501 - 'name': (str, none_type,), # noqa: E501 - 'case_class_array': ([str], none_type,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - + excluded_fields: Set[str] = set([ + ]) - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_status_id': 'caseStatusId', # noqa: E501 - 'case_status_group_id': 'caseStatusGroupId', # noqa: E501 - 'case_status_group': 'caseStatusGroup', # noqa: E501 - 'name': 'name', # noqa: E501 - 'case_class_array': 'caseClassArray', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None - read_only_vars = { - } - - _composed_schemas = {} + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_status_id, case_status_group_id, case_status_group, name, case_class_array, created_date, *args, **kwargs): # noqa: E501 - """CaseStatus - a model defined in OpenAPI - - Args: - case_status_id (str): - case_status_group_id (str): - case_status_group (str): - name (str, none_type): - case_class_array ([str], none_type): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CaseStatus" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseStatus") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_status_id = case_status_id - self.case_status_group_id = case_status_group_id - self.case_status_group = case_status_group - self.name = name - self.case_class_array = case_class_array - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_status_id, case_status_group_id, case_status_group, name, case_class_array, created_date, *args, **kwargs): # noqa: E501 - """CaseStatus - a model defined in OpenAPI - - Args: - case_status_id (str): - case_status_group_id (str): - case_status_group (str): - name (str, none_type): - case_class_array ([str], none_type): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CaseStatus" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseStatus") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseStatus', + "caseStatusId": obj.get("caseStatusId"), + "caseStatusGroupId": obj.get("caseStatusGroupId"), + "caseStatusGroup": obj.get("caseStatusGroup"), + "name": obj.get("name"), + "caseClassArray": obj.get("caseClassArray"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_status_id = case_status_id - self.case_status_group_id = case_status_group_id - self.case_status_group = case_status_group - self.name = name - self.case_class_array = case_class_array - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_status_group.py b/unicourt/model/case_status_group.py index 2af842a..f0b1552 100644 --- a/unicourt/model/case_status_group.py +++ b/unicourt/model/case_status_group.py @@ -1,305 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CaseStatusGroup(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseStatusGroup(BaseModel): """ + CaseStatusGroup + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=15, strict=True, max_length=15)]] = 'CaseStatusGroup' + case_status_group_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="caseStatusGroupId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "caseStatusGroupId", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 15, - 'min_length': 15, - }, - ('case_status_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseStatusGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'case_status_group_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_status_group_id': 'caseStatusGroupId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_status_group_id, name, created_date, *args, **kwargs): # noqa: E501 - """CaseStatusGroup - a model defined in OpenAPI - - Args: - case_status_group_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CaseStatusGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseStatusGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_status_group_id = case_status_group_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_status_group_id, name, created_date, *args, **kwargs): # noqa: E501 - """CaseStatusGroup - a model defined in OpenAPI - - Args: - case_status_group_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CaseStatusGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseStatusGroup from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseStatusGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseStatusGroup', + "caseStatusGroupId": obj.get("caseStatusGroupId"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_status_group_id = case_status_group_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_status_group_response.py b/unicourt/model/case_status_group_response.py index 8889f0a..6fcd85b 100644 --- a/unicourt/model/case_status_group_response.py +++ b/unicourt/model/case_status_group_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_status_group import CaseStatusGroup - globals()['CaseStatusGroup'] = CaseStatusGroup - - -class CaseStatusGroupResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 23, - 'min_length': 23, - }, - ('case_status_group_array',): { - }, - ('next_page_api',): { - 'max_length': 2148, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2147, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_status_group_array': ([CaseStatusGroup],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_status_group_array': 'caseStatusGroupArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_status_group import CaseStatusGroup +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseStatusGroupResponse(BaseModel): + """ + CaseStatusGroupResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=23, strict=True, max_length=23)]] = 'CaseStatusGroupResponse' + case_status_group_array: Optional[List[CaseStatusGroup]] = Field(default=None, alias="caseStatusGroupArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2148)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2147)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "caseStatusGroupArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_status_group_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseStatusGroupResponse - a model defined in OpenAPI - - Args: - case_status_group_array ([CaseStatusGroup]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CaseStatusGroupResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseStatusGroupResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseStatusGroupResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.case_status_group_array = case_status_group_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, case_status_group_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseStatusGroupResponse - a model defined in OpenAPI - - Args: - case_status_group_array ([CaseStatusGroup]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CaseStatusGroupResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in case_status_group_array (list) + _items = [] + if self.case_status_group_array: + for _item in self.case_status_group_array: + if _item: + _items.append(_item.to_dict()) + _dict['caseStatusGroupArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseStatusGroupResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseStatusGroupResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseStatusGroupResponse', + "caseStatusGroupArray": [CaseStatusGroup.from_dict(_item) for _item in obj["caseStatusGroupArray"]] if obj.get("caseStatusGroupArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_status_group_array = case_status_group_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_status_response.py b/unicourt/model/case_status_response.py index 3568485..7173616 100644 --- a/unicourt/model/case_status_response.py +++ b/unicourt/model/case_status_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_status import CaseStatus - globals()['CaseStatus'] = CaseStatus - - -class CaseStatusResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_status_array',): { - }, - ('next_page_api',): { - 'max_length': 2143, - 'min_length': 18, - }, - ('previous_page_api',): { - 'max_length': 2142, - 'min_length': 18, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_status_array': ([CaseStatus],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_status_array': 'caseStatusArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_status import CaseStatus +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseStatusResponse(BaseModel): + """ + CaseStatusResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = 'CaseStatusResponse' + case_status_array: Optional[List[CaseStatus]] = Field(default=None, alias="caseStatusArray") + next_page_api: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=2143)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=2142)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "caseStatusArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_status_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseStatusResponse - a model defined in OpenAPI - - Args: - case_status_array ([CaseStatus]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CaseStatusResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseStatusResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseStatusResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.case_status_array = case_status_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, case_status_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseStatusResponse - a model defined in OpenAPI - - Args: - case_status_array ([CaseStatus]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CaseStatusResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in case_status_array (list) + _items = [] + if self.case_status_array: + for _item in self.case_status_array: + if _item: + _items.append(_item.to_dict()) + _dict['caseStatusArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseStatusResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseStatusResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseStatusResponse', + "caseStatusArray": [CaseStatus.from_dict(_item) for _item in obj["caseStatusArray"]] if obj.get("caseStatusArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_status_array = case_status_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_timeline.py b/unicourt/model/case_timeline.py index bd6c8e2..9065d4f 100644 --- a/unicourt/model/case_timeline.py +++ b/unicourt/model/case_timeline.py @@ -1,292 +1,93 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class CaseTimeline(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 12, - }, - ('first_case_filed_date',): { - 'max_length': 25, - }, - ('last_case_filed_date',): { - 'max_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'first_case_filed_date': (datetime,), # noqa: E501 - 'last_case_filed_date': (datetime,), # noqa: E501 - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class CaseTimeline(BaseModel): + """ + CaseTimeline + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=12)]] = 'CaseTimeline' + first_case_filed_date: Optional[datetime] = Field(default=None, description="The first date when the two entities have appeared together in the case. (These dates are determined from case filed dates)", alias="firstCaseFiledDate") + last_case_filed_date: Optional[datetime] = Field(default=None, description="The last date when the two entities have appeared together in the case. (These dates are determined from case filed dates)", alias="lastCaseFiledDate") + __properties: ClassVar[List[str]] = ["object", "firstCaseFiledDate", "lastCaseFiledDate"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'object': 'object', # noqa: E501 - 'first_case_filed_date': 'firstCaseFiledDate', # noqa: E501 - 'last_case_filed_date': 'lastCaseFiledDate', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, first_case_filed_date, last_case_filed_date, *args, **kwargs): # noqa: E501 - """CaseTimeline - a model defined in OpenAPI - - Args: - first_case_filed_date (datetime): The first date when the two entities have appeared together in the case. (These dates are determined from case filed dates) - last_case_filed_date (datetime): The last date when the two entities have appeared together in the case. (These dates are determined from case filed dates) - - Keyword Args: - object (str): defaults to "CaseTimeline" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseTimeline from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "CaseTimeline") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.first_case_filed_date = first_case_filed_date - self.last_case_filed_date = last_case_filed_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, first_case_filed_date, last_case_filed_date, *args, **kwargs): # noqa: E501 - """CaseTimeline - a model defined in OpenAPI + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - Args: - first_case_filed_date (datetime): The first date when the two entities have appeared together in the case. (These dates are determined from case filed dates) - last_case_filed_date (datetime): The last date when the two entities have appeared together in the case. (These dates are determined from case filed dates) + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict - Keyword Args: - object (str): defaults to "CaseTimeline" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseTimeline from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseTimeline") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseTimeline', + "firstCaseFiledDate": obj.get("firstCaseFiledDate"), + "lastCaseFiledDate": obj.get("lastCaseFiledDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.first_case_filed_date = first_case_filed_date - self.last_case_filed_date = last_case_filed_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_track.py b/unicourt/model/case_track.py index 5db4001..2db1769 100644 --- a/unicourt/model/case_track.py +++ b/unicourt/model/case_track.py @@ -1,351 +1,131 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case import Case - from unicourt.model.case_update_pacer_options_response import CaseUpdatePacerOptionsResponse - from unicourt.model.last_tracked_details import LastTrackedDetails - from unicourt.model.schedule import Schedule - globals()['Case'] = Case - globals()['CaseUpdatePacerOptionsResponse'] = CaseUpdatePacerOptionsResponse - globals()['LastTrackedDetails'] = LastTrackedDetails - globals()['Schedule'] = Schedule - - -class CaseTrack(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 9, - 'min_length': 9, - }, - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date_with_updates',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_api',): { - 'max_length': 255, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_id': (str,), # noqa: E501 - 'pacer_options': (CaseUpdatePacerOptionsResponse,), # noqa: E501 - 'schedule': (Schedule,), # noqa: E501 - 'last_tracked_details': (LastTrackedDetails,), # noqa: E501 - 'last_fetch_date': (datetime, none_type,), # noqa: E501 - 'last_fetch_date_with_updates': (datetime, none_type,), # noqa: E501 - 'case_api': (str,), # noqa: E501 - 'case': (Case,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_id': 'caseId', # noqa: E501 - 'pacer_options': 'pacerOptions', # noqa: E501 - 'schedule': 'schedule', # noqa: E501 - 'last_tracked_details': 'lastTrackedDetails', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'last_fetch_date_with_updates': 'lastFetchDateWithUpdates', # noqa: E501 - 'case_api': 'caseAPI', # noqa: E501 - 'case': 'case', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case import Case +from unicourt.model.case_update_pacer_options_response import CaseUpdatePacerOptionsResponse +from unicourt.model.last_tracked_details import LastTrackedDetails +from unicourt.model.schedule import Schedule +from typing import Optional, Set +from typing_extensions import Self + +class CaseTrack(BaseModel): + """ + CaseTrack + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]] = Field(default='CaseTrack', description="Name of the object.") + case_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Unique Id for a Case in UniCourt.", alias="caseId") + pacer_options: Optional[CaseUpdatePacerOptionsResponse] = Field(default=None, alias="pacerOptions") + schedule: Optional[Schedule] = None + last_tracked_details: Optional[LastTrackedDetails] = Field(default=None, alias="lastTrackedDetails") + last_fetch_date: Optional[datetime] = Field(default=None, description="The date and time when the case was last fetched from the Court. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, Note: It is not necessary that every time the case is fetched from Court we find changes in the case information. It could be that we already have the latest information from the Court and no changes exist.", alias="lastFetchDate") + last_fetch_date_with_updates: Optional[datetime] = Field(default=None, description="The date and time when the case was last fetched from the Court where we found changes in the case information. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz,", alias="lastFetchDateWithUpdates") + case_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="caseAPI") + case: Optional[Case] = None + __properties: ClassVar[List[str]] = ["object", "caseId", "pacerOptions", "schedule", "lastTrackedDetails", "lastFetchDate", "lastFetchDateWithUpdates", "caseAPI", "case"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_id, pacer_options, schedule, last_tracked_details, last_fetch_date, last_fetch_date_with_updates, case_api, case, *args, **kwargs): # noqa: E501 - """CaseTrack - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseTrack from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - case_id (str): Unique Id for a Case in UniCourt. - pacer_options (CaseUpdatePacerOptionsResponse): - schedule (Schedule): - last_tracked_details (LastTrackedDetails): - last_fetch_date (datetime, none_type): The date and time when the case was last fetched from the Court. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, Note: It is not necessary that every time the case is fetched from Court we find changes in the case information. It could be that we already have the latest information from the Court and no changes exist. - last_fetch_date_with_updates (datetime, none_type): The date and time when the case was last fetched from the Court where we found changes in the case information. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, - case_api (str): - case (Case): - - Keyword Args: - object (str): Name of the object.. defaults to "CaseTrack" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "CaseTrack") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_id = case_id - self.pacer_options = pacer_options - self.schedule = schedule - self.last_tracked_details = last_tracked_details - self.last_fetch_date = last_fetch_date - self.last_fetch_date_with_updates = last_fetch_date_with_updates - self.case_api = case_api - self.case = case - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_id, pacer_options, schedule, last_tracked_details, last_fetch_date, last_fetch_date_with_updates, case_api, case, *args, **kwargs): # noqa: E501 - """CaseTrack - a model defined in OpenAPI - - Args: - case_id (str): Unique Id for a Case in UniCourt. - pacer_options (CaseUpdatePacerOptionsResponse): - schedule (Schedule): - last_tracked_details (LastTrackedDetails): - last_fetch_date (datetime, none_type): The date and time when the case was last fetched from the Court. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, Note: It is not necessary that every time the case is fetched from Court we find changes in the case information. It could be that we already have the latest information from the Court and no changes exist. - last_fetch_date_with_updates (datetime, none_type): The date and time when the case was last fetched from the Court where we found changes in the case information. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, - case_api (str): - case (Case): - - Keyword Args: - object (str): Name of the object.. defaults to "CaseTrack" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pacer_options + if self.pacer_options: + _dict['pacerOptions'] = self.pacer_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of schedule + if self.schedule: + _dict['schedule'] = self.schedule.to_dict() + # override the default output from pydantic by calling `to_dict()` of last_tracked_details + if self.last_tracked_details: + _dict['lastTrackedDetails'] = self.last_tracked_details.to_dict() + # override the default output from pydantic by calling `to_dict()` of case + if self.case: + _dict['case'] = self.case.to_dict() + # set to None if last_fetch_date (nullable) is None + # and model_fields_set contains the field + if self.last_fetch_date is None and "last_fetch_date" in self.model_fields_set: + _dict['lastFetchDate'] = None + + # set to None if last_fetch_date_with_updates (nullable) is None + # and model_fields_set contains the field + if self.last_fetch_date_with_updates is None and "last_fetch_date_with_updates" in self.model_fields_set: + _dict['lastFetchDateWithUpdates'] = None + + return _dict - object = kwargs.get('object', "CaseTrack") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseTrack from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseTrack', + "caseId": obj.get("caseId"), + "pacerOptions": CaseUpdatePacerOptionsResponse.from_dict(obj["pacerOptions"]) if obj.get("pacerOptions") is not None else None, + "schedule": Schedule.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None, + "lastTrackedDetails": LastTrackedDetails.from_dict(obj["lastTrackedDetails"]) if obj.get("lastTrackedDetails") is not None else None, + "lastFetchDate": obj.get("lastFetchDate"), + "lastFetchDateWithUpdates": obj.get("lastFetchDateWithUpdates"), + "caseAPI": obj.get("caseAPI"), + "case": Case.from_dict(obj["case"]) if obj.get("case") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_id = case_id - self.pacer_options = pacer_options - self.schedule = schedule - self.last_tracked_details = last_tracked_details - self.last_fetch_date = last_fetch_date - self.last_fetch_date_with_updates = last_fetch_date_with_updates - self.case_api = case_api - self.case = case - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_track_list_response.py b/unicourt/model/case_track_list_response.py index 11cdaee..5fc4ef2 100644 --- a/unicourt/model/case_track_list_response.py +++ b/unicourt/model/case_track_list_response.py @@ -1,329 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_track_preview import CaseTrackPreview - globals()['CaseTrackPreview'] = CaseTrackPreview - - -class CaseTrackListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 21, - 'min_length': 21, - }, - ('next_page_api',): { - 'max_length': 1024, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 1024, - 'min_length': 1, - }, - ('case_track_preview_array',): { - 'max_items': 100, - 'min_items': 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'case_track_preview_array': ([CaseTrackPreview],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'case_track_preview_array': 'caseTrackPreviewArray', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_track_preview import CaseTrackPreview +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseTrackListResponse(BaseModel): + """ + CaseTrackListResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=21, strict=True, max_length=21)]] = Field(default='CaseTrackListResponse', description="Name of the object.") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages available.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of case track available.", alias="totalCount") + page_number: Optional[StrictInt] = Field(default=None, description="Current page number.", alias="pageNumber") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field(default=None, description="Link for the next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field(default=None, description="Link for the previous page.", alias="previousPageAPI") + case_track_preview_array: Optional[Annotated[List[CaseTrackPreview], Field(min_length=0, max_length=100)]] = Field(default=None, description="Array of cases tracked.", alias="caseTrackPreviewArray") + __properties: ClassVar[List[str]] = ["object", "totalPages", "totalCount", "pageNumber", "nextPageAPI", "previousPageAPI", "caseTrackPreviewArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, total_pages, total_count, page_number, next_page_api, previous_page_api, case_track_preview_array, *args, **kwargs): # noqa: E501 - """CaseTrackListResponse - a model defined in OpenAPI - - Args: - total_pages (int): Total number of pages available. - total_count (int): Total number of case track available. - page_number (int): Current page number. - next_page_api (str, none_type): Link for the next page. - previous_page_api (str, none_type): Link for the previous page. - case_track_preview_array ([CaseTrackPreview]): Array of cases tracked. - - Keyword Args: - object (str): Name of the object.. defaults to "CaseTrackListResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseTrackListResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseTrackListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.total_pages = total_pages - self.total_count = total_count - self.page_number = page_number - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.case_track_preview_array = case_track_preview_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, total_pages, total_count, page_number, next_page_api, previous_page_api, case_track_preview_array, *args, **kwargs): # noqa: E501 - """CaseTrackListResponse - a model defined in OpenAPI - - Args: - total_pages (int): Total number of pages available. - total_count (int): Total number of case track available. - page_number (int): Current page number. - next_page_api (str, none_type): Link for the next page. - previous_page_api (str, none_type): Link for the previous page. - case_track_preview_array ([CaseTrackPreview]): Array of cases tracked. - - Keyword Args: - object (str): Name of the object.. defaults to "CaseTrackListResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in case_track_preview_array (list) + _items = [] + if self.case_track_preview_array: + for _item in self.case_track_preview_array: + if _item: + _items.append(_item.to_dict()) + _dict['caseTrackPreviewArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseTrackListResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseTrackListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseTrackListResponse', + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount"), + "pageNumber": obj.get("pageNumber"), + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "caseTrackPreviewArray": [CaseTrackPreview.from_dict(_item) for _item in obj["caseTrackPreviewArray"]] if obj.get("caseTrackPreviewArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.total_pages = total_pages - self.total_count = total_count - self.page_number = page_number - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.case_track_preview_array = case_track_preview_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_track_preview.py b/unicourt/model/case_track_preview.py index 2cfc352..2de36a6 100644 --- a/unicourt/model/case_track_preview.py +++ b/unicourt/model/case_track_preview.py @@ -1,343 +1,125 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_update_pacer_options_response import CaseUpdatePacerOptionsResponse - from unicourt.model.last_tracked_details import LastTrackedDetails - from unicourt.model.schedule import Schedule - globals()['CaseUpdatePacerOptionsResponse'] = CaseUpdatePacerOptionsResponse - globals()['LastTrackedDetails'] = LastTrackedDetails - globals()['Schedule'] = Schedule - - -class CaseTrackPreview(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 16, - 'min_length': 16, - }, - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date_with_updates',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_api',): { - 'max_length': 255, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_id': (str,), # noqa: E501 - 'pacer_options': (CaseUpdatePacerOptionsResponse,), # noqa: E501 - 'schedule': (Schedule,), # noqa: E501 - 'last_tracked_details': (LastTrackedDetails,), # noqa: E501 - 'last_fetch_date': (datetime, none_type,), # noqa: E501 - 'last_fetch_date_with_updates': (datetime, none_type,), # noqa: E501 - 'case_api': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_id': 'caseId', # noqa: E501 - 'pacer_options': 'pacerOptions', # noqa: E501 - 'schedule': 'schedule', # noqa: E501 - 'last_tracked_details': 'lastTrackedDetails', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'last_fetch_date_with_updates': 'lastFetchDateWithUpdates', # noqa: E501 - 'case_api': 'caseAPI', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_update_pacer_options_response import CaseUpdatePacerOptionsResponse +from unicourt.model.last_tracked_details import LastTrackedDetails +from unicourt.model.schedule import Schedule +from typing import Optional, Set +from typing_extensions import Self + +class CaseTrackPreview(BaseModel): + """ + CaseTrackPreview + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=16, strict=True, max_length=16)]] = Field(default='CaseTrackPreview', description="Name of the object.") + case_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Unique Id for a Case in UniCourt.", alias="caseId") + pacer_options: Optional[CaseUpdatePacerOptionsResponse] = Field(default=None, alias="pacerOptions") + schedule: Optional[Schedule] = None + last_tracked_details: Optional[LastTrackedDetails] = Field(default=None, alias="lastTrackedDetails") + last_fetch_date: Optional[datetime] = Field(default=None, description="The date and time when the case was last fetched from the Court. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, Note: It is not necessary that every time the case is fetched from Court we find changes in the case information. It could be that we already have the latest information from the Court and no changes exist.", alias="lastFetchDate") + last_fetch_date_with_updates: Optional[datetime] = Field(default=None, description="The date and time when the case was last fetched from the Court where we found changes in the case information. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz,", alias="lastFetchDateWithUpdates") + case_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="caseAPI") + __properties: ClassVar[List[str]] = ["object", "caseId", "pacerOptions", "schedule", "lastTrackedDetails", "lastFetchDate", "lastFetchDateWithUpdates", "caseAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_id, pacer_options, schedule, last_tracked_details, last_fetch_date, last_fetch_date_with_updates, case_api, *args, **kwargs): # noqa: E501 - """CaseTrackPreview - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseTrackPreview from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - case_id (str): Unique Id for a Case in UniCourt. - pacer_options (CaseUpdatePacerOptionsResponse): - schedule (Schedule): - last_tracked_details (LastTrackedDetails): - last_fetch_date (datetime, none_type): The date and time when the case was last fetched from the Court. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, Note: It is not necessary that every time the case is fetched from Court we find changes in the case information. It could be that we already have the latest information from the Court and no changes exist. - last_fetch_date_with_updates (datetime, none_type): The date and time when the case was last fetched from the Court where we found changes in the case information. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, - case_api (str): - - Keyword Args: - object (str): Name of the object.. defaults to "CaseTrackPreview" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "CaseTrackPreview") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_id = case_id - self.pacer_options = pacer_options - self.schedule = schedule - self.last_tracked_details = last_tracked_details - self.last_fetch_date = last_fetch_date - self.last_fetch_date_with_updates = last_fetch_date_with_updates - self.case_api = case_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_id, pacer_options, schedule, last_tracked_details, last_fetch_date, last_fetch_date_with_updates, case_api, *args, **kwargs): # noqa: E501 - """CaseTrackPreview - a model defined in OpenAPI - - Args: - case_id (str): Unique Id for a Case in UniCourt. - pacer_options (CaseUpdatePacerOptionsResponse): - schedule (Schedule): - last_tracked_details (LastTrackedDetails): - last_fetch_date (datetime, none_type): The date and time when the case was last fetched from the Court. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, Note: It is not necessary that every time the case is fetched from Court we find changes in the case information. It could be that we already have the latest information from the Court and no changes exist. - last_fetch_date_with_updates (datetime, none_type): The date and time when the case was last fetched from the Court where we found changes in the case information. This date and time is in UTC. Formatted as YYYY-MM-DDTHH:MM:SS+ZZ:zz, - case_api (str): - - Keyword Args: - object (str): Name of the object.. defaults to "CaseTrackPreview" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pacer_options + if self.pacer_options: + _dict['pacerOptions'] = self.pacer_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of schedule + if self.schedule: + _dict['schedule'] = self.schedule.to_dict() + # override the default output from pydantic by calling `to_dict()` of last_tracked_details + if self.last_tracked_details: + _dict['lastTrackedDetails'] = self.last_tracked_details.to_dict() + # set to None if last_fetch_date (nullable) is None + # and model_fields_set contains the field + if self.last_fetch_date is None and "last_fetch_date" in self.model_fields_set: + _dict['lastFetchDate'] = None + + # set to None if last_fetch_date_with_updates (nullable) is None + # and model_fields_set contains the field + if self.last_fetch_date_with_updates is None and "last_fetch_date_with_updates" in self.model_fields_set: + _dict['lastFetchDateWithUpdates'] = None + + return _dict - object = kwargs.get('object', "CaseTrackPreview") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseTrackPreview from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseTrackPreview', + "caseId": obj.get("caseId"), + "pacerOptions": CaseUpdatePacerOptionsResponse.from_dict(obj["pacerOptions"]) if obj.get("pacerOptions") is not None else None, + "schedule": Schedule.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None, + "lastTrackedDetails": LastTrackedDetails.from_dict(obj["lastTrackedDetails"]) if obj.get("lastTrackedDetails") is not None else None, + "lastFetchDate": obj.get("lastFetchDate"), + "lastFetchDateWithUpdates": obj.get("lastFetchDateWithUpdates"), + "caseAPI": obj.get("caseAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_id = case_id - self.pacer_options = pacer_options - self.schedule = schedule - self.last_tracked_details = last_tracked_details - self.last_fetch_date = last_fetch_date - self.last_fetch_date_with_updates = last_fetch_date_with_updates - self.case_api = case_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_track_request.py b/unicourt/model/case_track_request.py index 0eb362d..4cae0be 100644 --- a/unicourt/model/case_track_request.py +++ b/unicourt/model/case_track_request.py @@ -1,283 +1,97 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_track_schedule import CaseTrackSchedule - from unicourt.model.case_update_request import CaseUpdateRequest - globals()['CaseTrackSchedule'] = CaseTrackSchedule - globals()['CaseUpdateRequest'] = CaseUpdateRequest - - -class CaseTrackRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'case_track_params': (CaseUpdateRequest,), # noqa: E501 - 'schedule': (CaseTrackSchedule,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from unicourt.model.case_track_schedule import CaseTrackSchedule +from unicourt.model.case_update_request import CaseUpdateRequest +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class CaseTrackRequest(BaseModel): + """ + CaseTrackRequest + """ # noqa: E501 + case_track_params: CaseUpdateRequest = Field(alias="caseTrackParams") + schedule: CaseTrackSchedule + __properties: ClassVar[List[str]] = ["caseTrackParams", "schedule"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'case_track_params': 'caseTrackParams', # noqa: E501 - 'schedule': 'schedule', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_track_params, schedule, *args, **kwargs): # noqa: E501 - """CaseTrackRequest - a model defined in OpenAPI - - Args: - case_track_params (CaseUpdateRequest): - schedule (CaseTrackSchedule): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseTrackRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.case_track_params = case_track_params - self.schedule = schedule - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_track_params, schedule, *args, **kwargs): # noqa: E501 - """CaseTrackRequest - a model defined in OpenAPI - - Args: - case_track_params (CaseUpdateRequest): - schedule (CaseTrackSchedule): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_track_params + if self.case_track_params: + _dict['caseTrackParams'] = self.case_track_params.to_dict() + # override the default output from pydantic by calling `to_dict()` of schedule + if self.schedule: + _dict['schedule'] = self.schedule.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseTrackRequest from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "caseTrackParams": CaseUpdateRequest.from_dict(obj["caseTrackParams"]) if obj.get("caseTrackParams") is not None else None, + "schedule": CaseTrackSchedule.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.case_track_params = case_track_params - self.schedule = schedule - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_track_schedule.py b/unicourt/model/case_track_schedule.py index ebdb83f..77efd4c 100644 --- a/unicourt/model/case_track_schedule.py +++ b/unicourt/model/case_track_schedule.py @@ -1,284 +1,97 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CaseTrackSchedule(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseTrackSchedule(BaseModel): """ + CaseTrackSchedule + """ # noqa: E501 + type: Annotated[str, Field(min_length=5, strict=True, max_length=7)] + days: List[StrictInt] = Field(description="[] -> if schedule type is daily
1-7 -> if schedule type is weekly
1-31 -> if schedule type is monthly ") + __properties: ClassVar[List[str]] = ["type", "days"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['daily', 'weekly', 'monthly']): + raise ValueError("must be one of enum values ('daily', 'weekly', 'monthly')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('type',): { - 'DAILY': "daily", - 'WEEKLY': "weekly", - 'MONTHLY': "monthly", - }, - } - - validations = { - ('type',): { - 'max_length': 7, - 'min_length': 5, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseTrackSchedule from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'type': (str,), # noqa: E501 - 'days': ([int],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'type': 'type', # noqa: E501 - 'days': 'days', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, days, *args, **kwargs): # noqa: E501 - """CaseTrackSchedule - a model defined in OpenAPI - - Args: - type (str): - days ([int]): [] -> if schedule type is daily
1-7 -> if schedule type is weekly
1-31 -> if schedule type is monthly - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.type = type - self.days = days - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, days, *args, **kwargs): # noqa: E501 - """CaseTrackSchedule - a model defined in OpenAPI - - Args: - type (str): - days ([int]): [] -> if schedule type is daily
1-7 -> if schedule type is weekly
1-31 -> if schedule type is monthly - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseTrackSchedule from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "type": obj.get("type"), + "days": obj.get("days") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.type = type - self.days = days - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_type.py b/unicourt/model/case_type.py index 59b22b6..efcafdd 100644 --- a/unicourt/model/case_type.py +++ b/unicourt/model/case_type.py @@ -1,385 +1,146 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class CaseType(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 8, - 'min_length': 8, - }, - ('case_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_class_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('area_of_law_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_type_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_class',): { - 'max_length': 255, - 'min_length': 1, - }, - ('area_of_law',): { - 'max_length': 255, - 'min_length': 1, - }, - ('case_type_group',): { - 'max_length': 255, - 'min_length': 1, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('sali_code',): { - 'max_length': 255, - 'min_length': 1, - }, - ('case_type_tag',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 255, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'case_type_id': (str,), # noqa: E501 - 'case_class_id': (str,), # noqa: E501 - 'area_of_law_id': (str, none_type,), # noqa: E501 - 'case_type_group_id': (str, none_type,), # noqa: E501 - 'case_class': (str,), # noqa: E501 - 'area_of_law': (str, none_type,), # noqa: E501 - 'case_type_group': (str, none_type,), # noqa: E501 - 'name': (str, none_type,), # noqa: E501 - 'sali_code': (str, none_type,), # noqa: E501 - 'case_type_tag': (str, none_type,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_type_id': 'caseTypeId', # noqa: E501 - 'case_class_id': 'caseClassId', # noqa: E501 - 'area_of_law_id': 'areaOfLawId', # noqa: E501 - 'case_type_group_id': 'caseTypeGroupId', # noqa: E501 - 'case_class': 'caseClass', # noqa: E501 - 'area_of_law': 'areaOfLaw', # noqa: E501 - 'case_type_group': 'caseTypeGroup', # noqa: E501 - 'name': 'name', # noqa: E501 - 'sali_code': 'saliCode', # noqa: E501 - 'case_type_tag': 'caseTypeTag', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseType(BaseModel): + """ + CaseType + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=8, strict=True, max_length=8)]] = 'CaseType' + case_type_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="caseTypeId") + case_class_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="caseClassId") + area_of_law_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="areaOfLawId") + case_type_group_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="caseTypeGroupId") + case_class: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="caseClass") + area_of_law: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="areaOfLaw") + case_type_group: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="caseTypeGroup") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + sali_code: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="saliCode") + case_type_tag: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="caseTypeTag") + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "caseTypeId", "caseClassId", "areaOfLawId", "caseTypeGroupId", "caseClass", "areaOfLaw", "caseTypeGroup", "name", "saliCode", "caseTypeTag", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_type_id, case_class_id, area_of_law_id, case_type_group_id, case_class, area_of_law, case_type_group, name, sali_code, case_type_tag, created_date, *args, **kwargs): # noqa: E501 - """CaseType - a model defined in OpenAPI - - Args: - case_type_id (str): - case_class_id (str): - area_of_law_id (str, none_type): - case_type_group_id (str, none_type): - case_class (str): - area_of_law (str, none_type): - case_type_group (str, none_type): - name (str, none_type): - sali_code (str, none_type): - case_type_tag (str, none_type): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CaseType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseType from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "CaseType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_type_id = case_type_id - self.case_class_id = case_class_id - self.area_of_law_id = area_of_law_id - self.case_type_group_id = case_type_group_id - self.case_class = case_class - self.area_of_law = area_of_law - self.case_type_group = case_type_group - self.name = name - self.sali_code = sali_code - self.case_type_tag = case_type_tag - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_type_id, case_class_id, area_of_law_id, case_type_group_id, case_class, area_of_law, case_type_group, name, sali_code, case_type_tag, created_date, *args, **kwargs): # noqa: E501 - """CaseType - a model defined in OpenAPI - - Args: - case_type_id (str): - case_class_id (str): - area_of_law_id (str, none_type): - case_type_group_id (str, none_type): - case_class (str): - area_of_law (str, none_type): - case_type_group (str, none_type): - name (str, none_type): - sali_code (str, none_type): - case_type_tag (str, none_type): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CaseType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if area_of_law_id (nullable) is None + # and model_fields_set contains the field + if self.area_of_law_id is None and "area_of_law_id" in self.model_fields_set: + _dict['areaOfLawId'] = None + + # set to None if case_type_group_id (nullable) is None + # and model_fields_set contains the field + if self.case_type_group_id is None and "case_type_group_id" in self.model_fields_set: + _dict['caseTypeGroupId'] = None + + # set to None if area_of_law (nullable) is None + # and model_fields_set contains the field + if self.area_of_law is None and "area_of_law" in self.model_fields_set: + _dict['areaOfLaw'] = None + + # set to None if case_type_group (nullable) is None + # and model_fields_set contains the field + if self.case_type_group is None and "case_type_group" in self.model_fields_set: + _dict['caseTypeGroup'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if sali_code (nullable) is None + # and model_fields_set contains the field + if self.sali_code is None and "sali_code" in self.model_fields_set: + _dict['saliCode'] = None + + # set to None if case_type_tag (nullable) is None + # and model_fields_set contains the field + if self.case_type_tag is None and "case_type_tag" in self.model_fields_set: + _dict['caseTypeTag'] = None + + return _dict - object = kwargs.get('object', "CaseType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseType', + "caseTypeId": obj.get("caseTypeId"), + "caseClassId": obj.get("caseClassId"), + "areaOfLawId": obj.get("areaOfLawId"), + "caseTypeGroupId": obj.get("caseTypeGroupId"), + "caseClass": obj.get("caseClass"), + "areaOfLaw": obj.get("areaOfLaw"), + "caseTypeGroup": obj.get("caseTypeGroup"), + "name": obj.get("name"), + "saliCode": obj.get("saliCode"), + "caseTypeTag": obj.get("caseTypeTag"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_type_id = case_type_id - self.case_class_id = case_class_id - self.area_of_law_id = area_of_law_id - self.case_type_group_id = case_type_group_id - self.case_class = case_class - self.area_of_law = area_of_law - self.case_type_group = case_type_group - self.name = name - self.sali_code = sali_code - self.case_type_tag = case_type_tag - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_type_group.py b/unicourt/model/case_type_group.py index 8358539..d83519f 100644 --- a/unicourt/model/case_type_group.py +++ b/unicourt/model/case_type_group.py @@ -1,345 +1,103 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class CaseTypeGroup(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 13, - 'min_length': 13, - }, - ('case_type_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_class_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('area_of_law_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_class',): { - 'max_length': 255, - 'min_length': 1, - }, - ('area_of_law',): { - 'max_length': 255, - 'min_length': 1, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'case_type_group_id': (str,), # noqa: E501 - 'case_class_id': (str,), # noqa: E501 - 'area_of_law_id': (str,), # noqa: E501 - 'case_class': (str,), # noqa: E501 - 'area_of_law': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_type_group_id': 'caseTypeGroupId', # noqa: E501 - 'case_class_id': 'caseClassId', # noqa: E501 - 'area_of_law_id': 'areaOfLawId', # noqa: E501 - 'case_class': 'caseClass', # noqa: E501 - 'area_of_law': 'areaOfLaw', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseTypeGroup(BaseModel): + """ + CaseTypeGroup + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=13, strict=True, max_length=13)]] = 'CaseTypeGroup' + case_type_group_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="caseTypeGroupId") + case_class_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="caseClassId") + area_of_law_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="areaOfLawId") + case_class: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="caseClass") + area_of_law: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="areaOfLaw") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "caseTypeGroupId", "caseClassId", "areaOfLawId", "caseClass", "areaOfLaw", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_type_group_id, case_class_id, area_of_law_id, case_class, area_of_law, name, created_date, *args, **kwargs): # noqa: E501 - """CaseTypeGroup - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseTypeGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - case_type_group_id (str): - case_class_id (str): - area_of_law_id (str): - case_class (str): - area_of_law (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CaseTypeGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "CaseTypeGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_type_group_id = case_type_group_id - self.case_class_id = case_class_id - self.area_of_law_id = area_of_law_id - self.case_class = case_class - self.area_of_law = area_of_law - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_type_group_id, case_class_id, area_of_law_id, case_class, area_of_law, name, created_date, *args, **kwargs): # noqa: E501 - """CaseTypeGroup - a model defined in OpenAPI - - Args: - case_type_group_id (str): - case_class_id (str): - area_of_law_id (str): - case_class (str): - area_of_law (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CaseTypeGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) - object = kwargs.get('object', "CaseTypeGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseTypeGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseTypeGroup', + "caseTypeGroupId": obj.get("caseTypeGroupId"), + "caseClassId": obj.get("caseClassId"), + "areaOfLawId": obj.get("areaOfLawId"), + "caseClass": obj.get("caseClass"), + "areaOfLaw": obj.get("areaOfLaw"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_type_group_id = case_type_group_id - self.case_class_id = case_class_id - self.area_of_law_id = area_of_law_id - self.case_class = case_class - self.area_of_law = area_of_law - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_type_group_response.py b/unicourt/model/case_type_group_response.py index 0431b39..dad3af8 100644 --- a/unicourt/model/case_type_group_response.py +++ b/unicourt/model/case_type_group_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_type_group import CaseTypeGroup - globals()['CaseTypeGroup'] = CaseTypeGroup - - -class CaseTypeGroupResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 21, - 'min_length': 21, - }, - ('case_type_group_array',): { - }, - ('next_page_api',): { - 'max_length': 2144, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2143, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_type_group_array': ([CaseTypeGroup],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_type_group_array': 'caseTypeGroupArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_type_group import CaseTypeGroup +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseTypeGroupResponse(BaseModel): + """ + CaseTypeGroupResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=21, strict=True, max_length=21)]] = 'CaseTypeGroupResponse' + case_type_group_array: Optional[List[CaseTypeGroup]] = Field(default=None, alias="caseTypeGroupArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2144)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2143)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "caseTypeGroupArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_type_group_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseTypeGroupResponse - a model defined in OpenAPI - - Args: - case_type_group_array ([CaseTypeGroup]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CaseTypeGroupResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseTypeGroupResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseTypeGroupResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.case_type_group_array = case_type_group_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, case_type_group_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseTypeGroupResponse - a model defined in OpenAPI - - Args: - case_type_group_array ([CaseTypeGroup]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CaseTypeGroupResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in case_type_group_array (list) + _items = [] + if self.case_type_group_array: + for _item in self.case_type_group_array: + if _item: + _items.append(_item.to_dict()) + _dict['caseTypeGroupArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseTypeGroupResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseTypeGroupResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseTypeGroupResponse', + "caseTypeGroupArray": [CaseTypeGroup.from_dict(_item) for _item in obj["caseTypeGroupArray"]] if obj.get("caseTypeGroupArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_type_group_array = case_type_group_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_type_response.py b/unicourt/model/case_type_response.py index 4d4831b..4ad1d2f 100644 --- a/unicourt/model/case_type_response.py +++ b/unicourt/model/case_type_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_type import CaseType - globals()['CaseType'] = CaseType - - -class CaseTypeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 16, - 'min_length': 16, - }, - ('case_type_array',): { - }, - ('next_page_api',): { - 'max_length': 2139, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2138, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_type_array': ([CaseType],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_type_array': 'caseTypeArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_type import CaseType +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseTypeResponse(BaseModel): + """ + CaseTypeResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=16, strict=True, max_length=16)]] = 'CaseTypeResponse' + case_type_array: Optional[List[CaseType]] = Field(default=None, alias="caseTypeArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2139)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2138)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "caseTypeArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_type_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseTypeResponse - a model defined in OpenAPI - - Args: - case_type_array ([CaseType]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CaseTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseTypeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.case_type_array = case_type_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, case_type_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CaseTypeResponse - a model defined in OpenAPI - - Args: - case_type_array ([CaseType]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CaseTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in case_type_array (list) + _items = [] + if self.case_type_array: + for _item in self.case_type_array: + if _item: + _items.append(_item.to_dict()) + _dict['caseTypeArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseTypeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseTypeResponse', + "caseTypeArray": [CaseType.from_dict(_item) for _item in obj["caseTypeArray"]] if obj.get("caseTypeArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_type_array = case_type_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_update.py b/unicourt/model/case_update.py index 4081ccb..18632bc 100644 --- a/unicourt/model/case_update.py +++ b/unicourt/model/case_update.py @@ -1,349 +1,125 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case import Case - from unicourt.model.case_update_pacer_options_response import CaseUpdatePacerOptionsResponse - from unicourt.model.exception import Exception - globals()['Case'] = Case - globals()['CaseUpdatePacerOptionsResponse'] = CaseUpdatePacerOptionsResponse - globals()['Exception'] = Exception - - -class CaseUpdate(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('status',): { - 'COMPLETE': "COMPLETE", - 'FAILURE': "FAILURE", - 'IN_PROGRESS': "IN_PROGRESS", - 'DELAYED': "DELAYED", - }, - } - - validations = { - ('object',): { - 'max_length': 10, - 'min_length': 10, - }, - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('status',): { - 'max_length': 11, - 'min_length': 7, - }, - ('requested_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_api',): { - 'max_length': 255, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_id': (str,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'requested_date': (datetime,), # noqa: E501 - 'case_api': (str,), # noqa: E501 - 'pacer_options': (CaseUpdatePacerOptionsResponse,), # noqa: E501 - 'exception': (Exception,), # noqa: E501 - 'case': (Case,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_id': 'caseId', # noqa: E501 - 'status': 'status', # noqa: E501 - 'requested_date': 'requestedDate', # noqa: E501 - 'case_api': 'caseAPI', # noqa: E501 - 'pacer_options': 'pacerOptions', # noqa: E501 - 'exception': 'exception', # noqa: E501 - 'case': 'case', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case import Case +from unicourt.model.case_update_pacer_options_response import CaseUpdatePacerOptionsResponse +from unicourt.model.exception import Exception +from typing import Optional, Set +from typing_extensions import Self + +class CaseUpdate(BaseModel): + """ + CaseUpdate + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=10, strict=True, max_length=10)]] = Field(default='CaseUpdate', description="Name of the object.") + case_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Unique Id for a Case in UniCourt.", alias="caseId") + status: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]] = Field(default=None, description="Status of the request.") + requested_date: Optional[datetime] = Field(default=None, description="The date and time when the case was last requested for update ", alias="requestedDate") + case_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="caseAPI") + pacer_options: Optional[CaseUpdatePacerOptionsResponse] = Field(default=None, alias="pacerOptions") + exception: Optional[Exception] = None + case: Optional[Case] = None + __properties: ClassVar[List[str]] = ["object", "caseId", "status", "requestedDate", "caseAPI", "pacerOptions", "exception", "case"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['COMPLETE', 'FAILURE', 'IN_PROGRESS', 'DELAYED']): + raise ValueError("must be one of enum values ('COMPLETE', 'FAILURE', 'IN_PROGRESS', 'DELAYED')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_id, status, requested_date, case_api, pacer_options, exception, case, *args, **kwargs): # noqa: E501 - """CaseUpdate - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseUpdate from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - case_id (str): Unique Id for a Case in UniCourt. - status (str): Status of the request. - requested_date (datetime): The date and time when the case was last requested for update - case_api (str): - pacer_options (CaseUpdatePacerOptionsResponse): - exception (Exception): - case (Case): - - Keyword Args: - object (str): Name of the object.. defaults to "CaseUpdate" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "CaseUpdate") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_id = case_id - self.status = status - self.requested_date = requested_date - self.case_api = case_api - self.pacer_options = pacer_options - self.exception = exception - self.case = case - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_id, status, requested_date, case_api, pacer_options, exception, case, *args, **kwargs): # noqa: E501 - """CaseUpdate - a model defined in OpenAPI - - Args: - case_id (str): Unique Id for a Case in UniCourt. - status (str): Status of the request. - requested_date (datetime): The date and time when the case was last requested for update - case_api (str): - pacer_options (CaseUpdatePacerOptionsResponse): - exception (Exception): - case (Case): - - Keyword Args: - object (str): Name of the object.. defaults to "CaseUpdate" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pacer_options + if self.pacer_options: + _dict['pacerOptions'] = self.pacer_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of exception + if self.exception: + _dict['exception'] = self.exception.to_dict() + # override the default output from pydantic by calling `to_dict()` of case + if self.case: + _dict['case'] = self.case.to_dict() + return _dict - object = kwargs.get('object', "CaseUpdate") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseUpdate', + "caseId": obj.get("caseId"), + "status": obj.get("status"), + "requestedDate": obj.get("requestedDate"), + "caseAPI": obj.get("caseAPI"), + "pacerOptions": CaseUpdatePacerOptionsResponse.from_dict(obj["pacerOptions"]) if obj.get("pacerOptions") is not None else None, + "exception": Exception.from_dict(obj["exception"]) if obj.get("exception") is not None else None, + "case": Case.from_dict(obj["case"]) if obj.get("case") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_id = case_id - self.status = status - self.requested_date = requested_date - self.case_api = case_api - self.pacer_options = pacer_options - self.exception = exception - self.case = case - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_update_list_response.py b/unicourt/model/case_update_list_response.py index 5951469..3822fd6 100644 --- a/unicourt/model/case_update_list_response.py +++ b/unicourt/model/case_update_list_response.py @@ -1,329 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_update_preview import CaseUpdatePreview - globals()['CaseUpdatePreview'] = CaseUpdatePreview - - -class CaseUpdateListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 22, - 'min_length': 22, - }, - ('next_page_api',): { - 'max_length': 1024, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 1024, - 'min_length': 1, - }, - ('case_update_preview_array',): { - 'max_items': 100, - 'min_items': 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'case_update_preview_array': ([CaseUpdatePreview],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'case_update_preview_array': 'caseUpdatePreviewArray', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_update_preview import CaseUpdatePreview +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CaseUpdateListResponse(BaseModel): + """ + CaseUpdateListResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=22, strict=True, max_length=22)]] = Field(default='CaseUpdateListResponse', description="Name of the object.") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages available.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of case update objects available.", alias="totalCount") + page_number: Optional[StrictInt] = Field(default=None, description="Current page number.", alias="pageNumber") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field(default=None, description="Link for the next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field(default=None, description="Link for the previous page.", alias="previousPageAPI") + case_update_preview_array: Optional[Annotated[List[CaseUpdatePreview], Field(min_length=0, max_length=100)]] = Field(default=None, description="Array of case update objects.", alias="caseUpdatePreviewArray") + __properties: ClassVar[List[str]] = ["object", "totalPages", "totalCount", "pageNumber", "nextPageAPI", "previousPageAPI", "caseUpdatePreviewArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, total_pages, total_count, page_number, next_page_api, previous_page_api, case_update_preview_array, *args, **kwargs): # noqa: E501 - """CaseUpdateListResponse - a model defined in OpenAPI - - Args: - total_pages (int): Total number of pages available. - total_count (int): Total number of case update objects available. - page_number (int): Current page number. - next_page_api (str, none_type): Link for the next page. - previous_page_api (str, none_type): Link for the previous page. - case_update_preview_array ([CaseUpdatePreview]): Array of case update objects. - - Keyword Args: - object (str): Name of the object.. defaults to "CaseUpdateListResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseUpdateListResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseUpdateListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.total_pages = total_pages - self.total_count = total_count - self.page_number = page_number - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.case_update_preview_array = case_update_preview_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, total_pages, total_count, page_number, next_page_api, previous_page_api, case_update_preview_array, *args, **kwargs): # noqa: E501 - """CaseUpdateListResponse - a model defined in OpenAPI - - Args: - total_pages (int): Total number of pages available. - total_count (int): Total number of case update objects available. - page_number (int): Current page number. - next_page_api (str, none_type): Link for the next page. - previous_page_api (str, none_type): Link for the previous page. - case_update_preview_array ([CaseUpdatePreview]): Array of case update objects. - - Keyword Args: - object (str): Name of the object.. defaults to "CaseUpdateListResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in case_update_preview_array (list) + _items = [] + if self.case_update_preview_array: + for _item in self.case_update_preview_array: + if _item: + _items.append(_item.to_dict()) + _dict['caseUpdatePreviewArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CaseUpdateListResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseUpdateListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseUpdateListResponse', + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount"), + "pageNumber": obj.get("pageNumber"), + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "caseUpdatePreviewArray": [CaseUpdatePreview.from_dict(_item) for _item in obj["caseUpdatePreviewArray"]] if obj.get("caseUpdatePreviewArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.total_pages = total_pages - self.total_count = total_count - self.page_number = page_number - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.case_update_preview_array = case_update_preview_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_update_pacer_options.py b/unicourt/model/case_update_pacer_options.py index b233e59..2bcad79 100644 --- a/unicourt/model/case_update_pacer_options.py +++ b/unicourt/model/case_update_pacer_options.py @@ -1,312 +1,134 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.case_update_pacer_options_additional_page_array_inner import CaseUpdatePacerOptionsAdditionalPageArrayInner - globals()['CaseUpdatePacerOptionsAdditionalPageArrayInner'] = CaseUpdatePacerOptionsAdditionalPageArrayInner +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class CaseUpdatePacerOptions(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_update_pacer_options_additional_page_array_inner import CaseUpdatePacerOptionsAdditionalPageArrayInner +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseUpdatePacerOptions(BaseModel): """ + Applicable for PACER cases. + """ # noqa: E501 + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40)] = Field(description="**Your PACER credentials username. This is mandatory when a PACER Case is being requested in the API. For Non PACER cases this is not mandatory. Suppose your request consists of Non PACER and PACER Cases then this needs to be passed becuase you are requesting a PACER case too.**", alias="pacerUserId") + pacer_client_code: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]] = Field(default=None, description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)", alias="pacerClientCode") + fetch_participants_if_older_than_days: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=0, description="**You can now limit the frequency at which parties and attorneys for a PACER case are fetched, helping to reduce PACER fees. If you track cases daily or hourly, you could accrue a large PACER bill.** **Currently, this option applies only to Federal PACER cases and is not available for bankruptcy and appeal cases within Federal PACER. For these case types, participants (parties and counsel) are fetched by default, and there is no option to exclude them.** **Use Case: Cases are typically updated to check for new docket entry filings. However every update to the PACER case costs money. Participants for a case change less often than docket entry filings. So fetching participants for every update might result in unnecessary PACER costs; especially in cases which have a lot of parties and attorneys. So instead of getting charged the minimum cost of $0.10 for an update which might have had few docket entries, you could end up spending $3 for every update because there were a lot of parties for that case that were also fetched.** **With this option you can choose when to fetch parties for cases based on when it was last fetched.** You can limit how often these participants are fetched in a PACER case to keep your PACER costs under control. Min days is 0 and Max days is 100. Example: 1. Specifying a value of 0 ensures that participants are fetched from PACER for this case update irrespective of when the participants were last fetched. 2. Specifying a value of 30 ensures that participants are fetched from PACER for this case update only if the last fetch was older than 30 days. ", alias="fetchParticipantsIfOlderThanDays") + refresh_type: Optional[Annotated[str, Field(min_length=21, strict=True, max_length=21)]] = Field(default='fetchNewDocketEntries', description="This flag determines whether to pull only new or pull all the docket entries for a PACER case being requested. Only one of the two values is allowed: - fetchNewDocketEntries: > Updates the PACER case with only new docket entries that have been added after the previous update of the case being requested. - fetchAllDocketEntries: > Updates the PACER case by re-parsing all dockets from #1 till latest docket entry available. ", alias="refreshType") + additional_page_array: Optional[List[CaseUpdatePacerOptionsAdditionalPageArrayInner]] = Field(default=None, description="Currently this option is only applicable for Federal PACER cases. The default behavior of the Case Update is to fetch the Docket Report from PACER which includes the parties and attorneys too. However if you need to fetch information for other pages in PACER you will need to specify it here. - associatedCases: > This will fetch the Associated Cases page in PACER if available. This page consists of related cases especially applicable for Multi-District Litigation cases and Member Cases. Including this option will internally link all related cases in our system. Data from this page will be available via the Related Cases API. - caseSummary: > This will fetch the Case Summary page in PACER if available. This page consists of additional case info which is not present in the Docket Report page. Data from this page will be structured and available as response in the Case API’s ```additional_info``` field. - listOfCreditors: > This page will fetch the “List Of Creditors” page for PACER Bankruptcy cases of case type \"bk\". Note that this page cannot be extracted for Bankruptcy cases of case type \"ap\" (Adversary Proceedings). This page consists of the Creditor information like the name and address of the Creditors. Data from this page will be structured and available as response in the Case API. ", alias="additionalPageArray") + __properties: ClassVar[List[str]] = ["pacerUserId", "pacerClientCode", "fetchParticipantsIfOlderThanDays", "refreshType", "additionalPageArray"] + + @field_validator('pacer_client_code') + def pacer_client_code_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9._\-\/]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9._\-\/]+$/") + return value + + @field_validator('refresh_type') + def refresh_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['fetchNewDocketEntries', 'fetchAllDocketEntries']): + raise ValueError("must be one of enum values ('fetchNewDocketEntries', 'fetchAllDocketEntries')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('refresh_type',): { - 'None': None, - 'FETCHNEWDOCKETENTRIES': "fetchNewDocketEntries", - 'FETCHALLDOCKETENTRIES': "fetchAllDocketEntries", - }, - } - - validations = { - ('pacer_user_id',): { - 'max_length': 40, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 0, - }, - ('fetch_participants_if_older_than_days',): { - 'inclusive_maximum': 100, - 'inclusive_minimum': 0, - }, - ('refresh_type',): { - 'max_length': 21, - 'min_length': 21, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseUpdatePacerOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'pacer_user_id': (str,), # noqa: E501 - 'pacer_client_code': (str, none_type,), # noqa: E501 - 'fetch_participants_if_older_than_days': (int,), # noqa: E501 - 'refresh_type': (str, none_type,), # noqa: E501 - 'additional_page_array': ([CaseUpdatePacerOptionsAdditionalPageArrayInner], none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'pacer_user_id': 'pacerUserId', # noqa: E501 - 'pacer_client_code': 'pacerClientCode', # noqa: E501 - 'fetch_participants_if_older_than_days': 'fetchParticipantsIfOlderThanDays', # noqa: E501 - 'refresh_type': 'refreshType', # noqa: E501 - 'additional_page_array': 'additionalPageArray', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in additional_page_array (list) + _items = [] + if self.additional_page_array: + for _item in self.additional_page_array: + if _item: + _items.append(_item.to_dict()) + _dict['additionalPageArray'] = _items + # set to None if pacer_client_code (nullable) is None + # and model_fields_set contains the field + if self.pacer_client_code is None and "pacer_client_code" in self.model_fields_set: + _dict['pacerClientCode'] = None + + # set to None if refresh_type (nullable) is None + # and model_fields_set contains the field + if self.refresh_type is None and "refresh_type" in self.model_fields_set: + _dict['refreshType'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pacer_user_id, *args, **kwargs): # noqa: E501 - """CaseUpdatePacerOptions - a model defined in OpenAPI - - Args: - pacer_user_id (str): **Your PACER credentials username. This is mandatory when a PACER Case is being requested in the API. For Non PACER cases this is not mandatory. Suppose your request consists of Non PACER and PACER Cases then this needs to be passed becuase you are requesting a PACER case too.** - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - pacer_client_code (str, none_type): PACER Client Code. This is mandatory if your setting in PACER website is set to True for required client code.. [optional] # noqa: E501 - fetch_participants_if_older_than_days (int): **Currently this option is only applicable for Federal PACER cases. You can limit how often parties and attorneys for a PACER case are fetched to reduce your PACER fees. If you are tracking cases daily or hourly you could easily end up with a large PACER bill.** **Use Case: Cases are typically updated to check for new docket entry filings. However every update to PACER case costs money. Participants for a case change less often than docket entry filings. So fetching participants for every update might result in unnecessary PACER costs; especially on cases which have a lot of parties and attorneys. So instead of getting charged the minimum cost of $0.10 for an update which might have had few docket entries, you could end up spending $3 for every update because there were a lot of parties for that case that were also fetched.** **With this option you can choose when to fetch parties for case based on when was it last fetched.** You can limit how often this participants are fetched in a PACER case to keep your PACER costs under control. Min days is 0 and Max days is 100. Example: 1. Specifying a value of 0 ensures that participants are fetched from PACER for this case update irrespective of when the participants were last fetched. 2. Specifying a value of 30 ensures that participants are fetched from PACER for this case update only if the last fetch was older than 30 days. . [optional] if omitted the server will use the default value of 0 # noqa: E501 - refresh_type (str, none_type): This flag determines whether to pull only new or pull all the docket entries for a PACER case being requested. Only one of the two values is allowed: - fetchNewDocketEntries: > Updates the PACER case with only new docket entries that have been added after the previous update of the case being requested. - fetchAllDocketEntries: > Updates the PACER case by re-parsing all dockets from #1 till latest docket entry available. . [optional] if omitted the server will use the default value of "fetchNewDocketEntries" # noqa: E501 - additional_page_array ([CaseUpdatePacerOptionsAdditionalPageArrayInner], none_type): Currently this option is only applicable for Federal PACER cases. The default behavior of the Case Update is to fetch the Docket Report from PACER which includes the parties and attorneys too. However if you need to fetch information for other pages in PACER you will need to specify it here. - associatedCases: > This will fetch the Associated Cases page in PACER if available. This page consists of related cases especially applicable for Multi-District Litigation cases and Member Cases. Including this option will internally link all related cases in our system. Data from this page will be available via the Related Cases API. - caseSummary: > This will fetch the Case Summary page in PACER if available. This page consists of additional case info which is not present in the Docket Report page. Data from this page will be structured and available as response in the Case API’s ```additional_info``` field. - listOfCreditors: > This page will fetch the “List Of Creditors” page for PACER Bankruptcy cases of case type \"bk\". Note that this page cannot be extracted for Bankruptcy cases of case type \"ap\" (Adversary Proceedings). This page consists of the Creditor information like the name and address of the Creditors. Data from this page will be structured and available as response in the Case API. . [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.pacer_user_id = pacer_user_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, pacer_user_id, *args, **kwargs): # noqa: E501 - """CaseUpdatePacerOptions - a model defined in OpenAPI - - Args: - pacer_user_id (str): **Your PACER credentials username. This is mandatory when a PACER Case is being requested in the API. For Non PACER cases this is not mandatory. Suppose your request consists of Non PACER and PACER Cases then this needs to be passed becuase you are requesting a PACER case too.** - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - pacer_client_code (str, none_type): PACER Client Code. This is mandatory if your setting in PACER website is set to True for required client code.. [optional] # noqa: E501 - fetch_participants_if_older_than_days (int): **Currently this option is only applicable for Federal PACER cases. You can limit how often parties and attorneys for a PACER case are fetched to reduce your PACER fees. If you are tracking cases daily or hourly you could easily end up with a large PACER bill.** **Use Case: Cases are typically updated to check for new docket entry filings. However every update to PACER case costs money. Participants for a case change less often than docket entry filings. So fetching participants for every update might result in unnecessary PACER costs; especially on cases which have a lot of parties and attorneys. So instead of getting charged the minimum cost of $0.10 for an update which might have had few docket entries, you could end up spending $3 for every update because there were a lot of parties for that case that were also fetched.** **With this option you can choose when to fetch parties for case based on when was it last fetched.** You can limit how often this participants are fetched in a PACER case to keep your PACER costs under control. Min days is 0 and Max days is 100. Example: 1. Specifying a value of 0 ensures that participants are fetched from PACER for this case update irrespective of when the participants were last fetched. 2. Specifying a value of 30 ensures that participants are fetched from PACER for this case update only if the last fetch was older than 30 days. . [optional] if omitted the server will use the default value of 0 # noqa: E501 - refresh_type (str, none_type): This flag determines whether to pull only new or pull all the docket entries for a PACER case being requested. Only one of the two values is allowed: - fetchNewDocketEntries: > Updates the PACER case with only new docket entries that have been added after the previous update of the case being requested. - fetchAllDocketEntries: > Updates the PACER case by re-parsing all dockets from #1 till latest docket entry available. . [optional] if omitted the server will use the default value of "fetchNewDocketEntries" # noqa: E501 - additional_page_array ([CaseUpdatePacerOptionsAdditionalPageArrayInner], none_type): Currently this option is only applicable for Federal PACER cases. The default behavior of the Case Update is to fetch the Docket Report from PACER which includes the parties and attorneys too. However if you need to fetch information for other pages in PACER you will need to specify it here. - associatedCases: > This will fetch the Associated Cases page in PACER if available. This page consists of related cases especially applicable for Multi-District Litigation cases and Member Cases. Including this option will internally link all related cases in our system. Data from this page will be available via the Related Cases API. - caseSummary: > This will fetch the Case Summary page in PACER if available. This page consists of additional case info which is not present in the Docket Report page. Data from this page will be structured and available as response in the Case API’s ```additional_info``` field. - listOfCreditors: > This page will fetch the “List Of Creditors” page for PACER Bankruptcy cases of case type \"bk\". Note that this page cannot be extracted for Bankruptcy cases of case type \"ap\" (Adversary Proceedings). This page consists of the Creditor information like the name and address of the Creditors. Data from this page will be structured and available as response in the Case API. . [optional] # noqa: E501 - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseUpdatePacerOptions from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "pacerUserId": obj.get("pacerUserId"), + "pacerClientCode": obj.get("pacerClientCode"), + "fetchParticipantsIfOlderThanDays": obj.get("fetchParticipantsIfOlderThanDays") if obj.get("fetchParticipantsIfOlderThanDays") is not None else 0, + "refreshType": obj.get("refreshType") if obj.get("refreshType") is not None else 'fetchNewDocketEntries', + "additionalPageArray": [CaseUpdatePacerOptionsAdditionalPageArrayInner.from_dict(_item) for _item in obj["additionalPageArray"]] if obj.get("additionalPageArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.pacer_user_id = pacer_user_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_update_pacer_options_additional_page_array_inner.py b/unicourt/model/case_update_pacer_options_additional_page_array_inner.py index e2adf79..385f7ca 100644 --- a/unicourt/model/case_update_pacer_options_additional_page_array_inner.py +++ b/unicourt/model/case_update_pacer_options_additional_page_array_inner.py @@ -1,280 +1,100 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 + Generated by OpenAPI Generator (https://openapi-generator.tech) -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class CaseUpdatePacerOptionsAdditionalPageArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseUpdatePacerOptionsAdditionalPageArrayInner(BaseModel): """ + CaseUpdatePacerOptionsAdditionalPageArrayInner + """ # noqa: E501 + page: Optional[Annotated[str, Field(min_length=11, strict=True, max_length=15)]] = None + fetch_if_older_than_days: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=0, description="You can limit how often this page information is fetched to reduce your PACER fees. Min days is 0 and Max days is 100. Example: 1. Specifying a value of 0 ensures that this page is fetched from PACER for this case update irrespective of when the page was last fetched. 2. Specifying a value of 30 ensures that this page is fetched from PACER for this case update only if the last fetch was older than 30 days. ", alias="fetchIfOlderThanDays") + __properties: ClassVar[List[str]] = ["page", "fetchIfOlderThanDays"] + + @field_validator('page') + def page_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['associatedCases', 'caseSummary', 'listOfCreditors']): + raise ValueError("must be one of enum values ('associatedCases', 'caseSummary', 'listOfCreditors')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('page',): { - 'ASSOCIATEDCASES': "associatedCases", - 'CASESUMMARY': "caseSummary", - 'LISTOFCREDITORS': "listOfCreditors", - }, - } - - validations = { - ('page',): { - 'max_length': 15, - 'min_length': 11, - }, - ('fetch_if_older_than_days',): { - 'inclusive_maximum': 100, - 'inclusive_minimum': 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseUpdatePacerOptionsAdditionalPageArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'page': (str,), # noqa: E501 - 'fetch_if_older_than_days': (int,), # noqa: E501 - } + excluded_fields: Set[str] = set([ + ]) - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'page': 'page', # noqa: E501 - 'fetch_if_older_than_days': 'fetchIfOlderThanDays', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """CaseUpdatePacerOptionsAdditionalPageArrayInner - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - page (str): [optional] # noqa: E501 - fetch_if_older_than_days (int): You can limit how often this page information is fetched to reduce your PACER fees. Min days is 0 and Max days is 100. Example: 1. Specifying a value of 0 ensures that this page is fetched from PACER for this case update irrespective of when the page was last fetched. 2. Specifying a value of 30 ensures that this page is fetched from PACER for this case update only if the last fetch was older than 30 days. . [optional] if omitted the server will use the default value of 0 # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """CaseUpdatePacerOptionsAdditionalPageArrayInner - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - page (str): [optional] # noqa: E501 - fetch_if_older_than_days (int): You can limit how often this page information is fetched to reduce your PACER fees. Min days is 0 and Max days is 100. Example: 1. Specifying a value of 0 ensures that this page is fetched from PACER for this case update irrespective of when the page was last fetched. 2. Specifying a value of 30 ensures that this page is fetched from PACER for this case update only if the last fetch was older than 30 days. . [optional] if omitted the server will use the default value of 0 # noqa: E501 - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseUpdatePacerOptionsAdditionalPageArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "page": obj.get("page"), + "fetchIfOlderThanDays": obj.get("fetchIfOlderThanDays") if obj.get("fetchIfOlderThanDays") is not None else 0 + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_update_pacer_options_response.py b/unicourt/model/case_update_pacer_options_response.py index 86adfff..3db4b45 100644 --- a/unicourt/model/case_update_pacer_options_response.py +++ b/unicourt/model/case_update_pacer_options_response.py @@ -1,336 +1,136 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.case_update_pacer_options_additional_page_array_inner import CaseUpdatePacerOptionsAdditionalPageArrayInner - globals()['CaseUpdatePacerOptionsAdditionalPageArrayInner'] = CaseUpdatePacerOptionsAdditionalPageArrayInner +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class CaseUpdatePacerOptionsResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_update_pacer_options_additional_page_array_inner import CaseUpdatePacerOptionsAdditionalPageArrayInner +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CaseUpdatePacerOptionsResponse(BaseModel): """ + Applicable for PACER cases. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=30, strict=True, max_length=30)]] = Field(default='CaseUpdatePacerOptionsResponse', description="Name of the object.") + pacer_user_id: Optional[Annotated[str, Field(min_length=6, strict=True, max_length=40)]] = Field(default=None, description="**Your PACER credentials username. This is mandatory when a PACER Case is being requested in the API. For Non PACER cases this is not mandatory. Suppose your request consists of Non PACER and PACER Cases then this needs to be passed becuase you are requesting a PACER case too.**", alias="pacerUserId") + pacer_client_code: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]] = Field(default=None, description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)", alias="pacerClientCode") + fetch_participants_if_older_than_days: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=0, description="**You can now limit the frequency at which parties and attorneys for a PACER case are fetched, helping to reduce PACER fees. If you track cases daily or hourly, you could accrue a large PACER bill.** **Currently, this option applies only to Federal PACER cases and is not available for bankruptcy and appeal cases within Federal PACER. For these case types, participants (parties and counsel) are fetched by default, and there is no option to exclude them.** **Use Case: Cases are typically updated to check for new docket entry filings. However every update to the PACER case costs money. Participants for a case change less often than docket entry filings. So fetching participants for every update might result in unnecessary PACER costs; especially in cases which have a lot of parties and attorneys. So instead of getting charged the minimum cost of $0.10 for an update which might have had few docket entries, you could end up spending $3 for every update because there were a lot of parties for that case that were also fetched.** **With this option you can choose when to fetch parties for cases based on when it was last fetched.** You can limit how often these participants are fetched in a PACER case to keep your PACER costs under control. Min days is 0 and Max days is 100. Example: 1. Specifying a value of 0 ensures that participants are fetched from PACER for this case update irrespective of when the participants were last fetched. 2. Specifying a value of 30 ensures that participants are fetched from PACER for this case update only if the last fetch was older than 30 days. ", alias="fetchParticipantsIfOlderThanDays") + refresh_type: Optional[Annotated[str, Field(min_length=21, strict=True, max_length=21)]] = Field(default='fetchNewDocketEntries', description="This flag determines whether to pull only new or pull all the docket entries for a PACER case being requested. Only one of the two values is allowed: - fetchNewDocketEntries: > Updates the PACER case with only new docket entries that have been added after the previous update of the case being requested. - fetchAllDocketEntries: > Updates the PACER case by re-parsing all dockets from #1 till latest docket entry available. ", alias="refreshType") + additional_page_array: Optional[List[CaseUpdatePacerOptionsAdditionalPageArrayInner]] = Field(default=None, description="Currently this option is only applicable for Federal PACER cases. The default behavior of the Case Update is to fetch the Docket Report from PACER which includes the parties and attorneys too. However if you need to fetch information for other pages in PACER you will need to specify it here. - associatedCases: > This will fetch the Associated Cases page in PACER if available. This page consists of related cases especially applicable for Multi-District Litigation cases and Member Cases. Including this option will internally link all related cases in our system. Data from this page will be available via the Related Cases API. - caseSummary: > This will fetch the Case Summary page in PACER if available. This page consists of additional case info which is not present in the Docket Report page. Data from this page will be structured and available as response in the Case API’s ```additional_info``` field. - listOfCreditors: > This page will fetch the “List Of Creditors” page for PACER Bankruptcy cases of case type \"bk\". Note that this page cannot be extracted for Bankruptcy cases of case type \"ap\" (Adversary Proceedings). This page consists of the Creditor information like the name and address of the Creditors. Data from this page will be structured and available as response in the Case API. ", alias="additionalPageArray") + __properties: ClassVar[List[str]] = ["object", "pacerUserId", "pacerClientCode", "fetchParticipantsIfOlderThanDays", "refreshType", "additionalPageArray"] + + @field_validator('pacer_client_code') + def pacer_client_code_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9._\-\/]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9._\-\/]+$/") + return value + + @field_validator('refresh_type') + def refresh_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['fetchNewDocketEntries', 'fetchAllDocketEntries']): + raise ValueError("must be one of enum values ('fetchNewDocketEntries', 'fetchAllDocketEntries')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('refresh_type',): { - 'None': None, - 'FETCHNEWDOCKETENTRIES': "fetchNewDocketEntries", - 'FETCHALLDOCKETENTRIES': "fetchAllDocketEntries", - }, - } - - validations = { - ('object',): { - 'max_length': 30, - 'min_length': 30, - }, - ('pacer_user_id',): { - 'max_length': 40, - 'min_length': 6, - }, - ('pacer_client_code',): { - 'max_length': 32, - 'min_length': 0, - }, - ('fetch_participants_if_older_than_days',): { - 'inclusive_maximum': 100, - 'inclusive_minimum': 0, - }, - ('refresh_type',): { - 'max_length': 21, - 'min_length': 21, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseUpdatePacerOptionsResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'pacer_user_id': (str,), # noqa: E501 - 'pacer_client_code': (str, none_type,), # noqa: E501 - 'fetch_participants_if_older_than_days': (int,), # noqa: E501 - 'refresh_type': (str, none_type,), # noqa: E501 - 'additional_page_array': ([CaseUpdatePacerOptionsAdditionalPageArrayInner], none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'pacer_user_id': 'pacerUserId', # noqa: E501 - 'pacer_client_code': 'pacerClientCode', # noqa: E501 - 'fetch_participants_if_older_than_days': 'fetchParticipantsIfOlderThanDays', # noqa: E501 - 'refresh_type': 'refreshType', # noqa: E501 - 'additional_page_array': 'additionalPageArray', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in additional_page_array (list) + _items = [] + if self.additional_page_array: + for _item in self.additional_page_array: + if _item: + _items.append(_item.to_dict()) + _dict['additionalPageArray'] = _items + # set to None if pacer_client_code (nullable) is None + # and model_fields_set contains the field + if self.pacer_client_code is None and "pacer_client_code" in self.model_fields_set: + _dict['pacerClientCode'] = None + + # set to None if refresh_type (nullable) is None + # and model_fields_set contains the field + if self.refresh_type is None and "refresh_type" in self.model_fields_set: + _dict['refreshType'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pacer_user_id, pacer_client_code, additional_page_array, *args, **kwargs): # noqa: E501 - """CaseUpdatePacerOptionsResponse - a model defined in OpenAPI - - Args: - pacer_user_id (str): **Your PACER credentials username. This is mandatory when a PACER Case is being requested in the API. For Non PACER cases this is not mandatory. Suppose your request consists of Non PACER and PACER Cases then this needs to be passed becuase you are requesting a PACER case too.** - pacer_client_code (str, none_type): PACER Client Code. This is mandatory if your setting in PACER website is set to True for required client code. - additional_page_array ([CaseUpdatePacerOptionsAdditionalPageArrayInner], none_type): Currently this option is only applicable for Federal PACER cases. The default behavior of the Case Update is to fetch the Docket Report from PACER which includes the parties and attorneys too. However if you need to fetch information for other pages in PACER you will need to specify it here. - associatedCases: > This will fetch the Associated Cases page in PACER if available. This page consists of related cases especially applicable for Multi-District Litigation cases and Member Cases. Including this option will internally link all related cases in our system. Data from this page will be available via the Related Cases API. - caseSummary: > This will fetch the Case Summary page in PACER if available. This page consists of additional case info which is not present in the Docket Report page. Data from this page will be structured and available as response in the Case API’s ```additional_info``` field. - listOfCreditors: > This page will fetch the “List Of Creditors” page for PACER Bankruptcy cases of case type \"bk\". Note that this page cannot be extracted for Bankruptcy cases of case type \"ap\" (Adversary Proceedings). This page consists of the Creditor information like the name and address of the Creditors. Data from this page will be structured and available as response in the Case API. - - Keyword Args: - object (str): Name of the object.. defaults to "CaseUpdatePacerOptionsResponse" # noqa: E501 - fetch_participants_if_older_than_days (int): **Currently this option is only applicable for Federal PACER cases. You can limit how often parties and attorneys for a PACER case are fetched to reduce your PACER fees. If you are tracking cases daily or hourly you could easily end up with a large PACER bill.** **Use Case: Cases are typically updated to check for new docket entry filings. However every update to PACER case costs money. Participants for a case change less often than docket entry filings. So fetching participants for every update might result in unnecessary PACER costs; especially on cases which have a lot of parties and attorneys. So instead of getting charged the minimum cost of $0.10 for an update which might have had few docket entries, you could end up spending $3 for every update because there were a lot of parties for that case that were also fetched.** **With this option you can choose when to fetch parties for case based on when was it last fetched.** You can limit how often this participants are fetched in a PACER case to keep your PACER costs under control. Min days is 0 and Max days is 100. Example: 1. Specifying a value of 0 ensures that participants are fetched from PACER for this case update irrespective of when the participants were last fetched. 2. Specifying a value of 30 ensures that participants are fetched from PACER for this case update only if the last fetch was older than 30 days. . defaults to 0 # noqa: E501 - refresh_type (str, none_type): This flag determines whether to pull only new or pull all the docket entries for a PACER case being requested. Only one of the two values is allowed: - fetchNewDocketEntries: > Updates the PACER case with only new docket entries that have been added after the previous update of the case being requested. - fetchAllDocketEntries: > Updates the PACER case by re-parsing all dockets from #1 till latest docket entry available. . defaults to "fetchNewDocketEntries", must be one of ["fetchNewDocketEntries", "fetchAllDocketEntries", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CaseUpdatePacerOptionsResponse") - fetch_participants_if_older_than_days = kwargs.get('fetch_participants_if_older_than_days', 0) - refresh_type = kwargs.get('refresh_type', "fetchNewDocketEntries") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.pacer_user_id = pacer_user_id - self.pacer_client_code = pacer_client_code - self.fetch_participants_if_older_than_days = fetch_participants_if_older_than_days - self.refresh_type = refresh_type - self.additional_page_array = additional_page_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, pacer_user_id, pacer_client_code, additional_page_array, *args, **kwargs): # noqa: E501 - """CaseUpdatePacerOptionsResponse - a model defined in OpenAPI - - Args: - pacer_user_id (str): **Your PACER credentials username. This is mandatory when a PACER Case is being requested in the API. For Non PACER cases this is not mandatory. Suppose your request consists of Non PACER and PACER Cases then this needs to be passed becuase you are requesting a PACER case too.** - pacer_client_code (str, none_type): PACER Client Code. This is mandatory if your setting in PACER website is set to True for required client code. - additional_page_array ([CaseUpdatePacerOptionsAdditionalPageArrayInner], none_type): Currently this option is only applicable for Federal PACER cases. The default behavior of the Case Update is to fetch the Docket Report from PACER which includes the parties and attorneys too. However if you need to fetch information for other pages in PACER you will need to specify it here. - associatedCases: > This will fetch the Associated Cases page in PACER if available. This page consists of related cases especially applicable for Multi-District Litigation cases and Member Cases. Including this option will internally link all related cases in our system. Data from this page will be available via the Related Cases API. - caseSummary: > This will fetch the Case Summary page in PACER if available. This page consists of additional case info which is not present in the Docket Report page. Data from this page will be structured and available as response in the Case API’s ```additional_info``` field. - listOfCreditors: > This page will fetch the “List Of Creditors” page for PACER Bankruptcy cases of case type \"bk\". Note that this page cannot be extracted for Bankruptcy cases of case type \"ap\" (Adversary Proceedings). This page consists of the Creditor information like the name and address of the Creditors. Data from this page will be structured and available as response in the Case API. - - Keyword Args: - object (str): Name of the object.. defaults to "CaseUpdatePacerOptionsResponse" # noqa: E501 - fetch_participants_if_older_than_days (int): **Currently this option is only applicable for Federal PACER cases. You can limit how often parties and attorneys for a PACER case are fetched to reduce your PACER fees. If you are tracking cases daily or hourly you could easily end up with a large PACER bill.** **Use Case: Cases are typically updated to check for new docket entry filings. However every update to PACER case costs money. Participants for a case change less often than docket entry filings. So fetching participants for every update might result in unnecessary PACER costs; especially on cases which have a lot of parties and attorneys. So instead of getting charged the minimum cost of $0.10 for an update which might have had few docket entries, you could end up spending $3 for every update because there were a lot of parties for that case that were also fetched.** **With this option you can choose when to fetch parties for case based on when was it last fetched.** You can limit how often this participants are fetched in a PACER case to keep your PACER costs under control. Min days is 0 and Max days is 100. Example: 1. Specifying a value of 0 ensures that participants are fetched from PACER for this case update irrespective of when the participants were last fetched. 2. Specifying a value of 30 ensures that participants are fetched from PACER for this case update only if the last fetch was older than 30 days. . defaults to 0 # noqa: E501 - refresh_type (str, none_type): This flag determines whether to pull only new or pull all the docket entries for a PACER case being requested. Only one of the two values is allowed: - fetchNewDocketEntries: > Updates the PACER case with only new docket entries that have been added after the previous update of the case being requested. - fetchAllDocketEntries: > Updates the PACER case by re-parsing all dockets from #1 till latest docket entry available. . defaults to "fetchNewDocketEntries", must be one of ["fetchNewDocketEntries", "fetchAllDocketEntries", ] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseUpdatePacerOptionsResponse from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CaseUpdatePacerOptionsResponse") - fetch_participants_if_older_than_days = kwargs.get('fetch_participants_if_older_than_days', 0) - refresh_type = kwargs.get('refresh_type', "fetchNewDocketEntries") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseUpdatePacerOptionsResponse', + "pacerUserId": obj.get("pacerUserId"), + "pacerClientCode": obj.get("pacerClientCode"), + "fetchParticipantsIfOlderThanDays": obj.get("fetchParticipantsIfOlderThanDays") if obj.get("fetchParticipantsIfOlderThanDays") is not None else 0, + "refreshType": obj.get("refreshType") if obj.get("refreshType") is not None else 'fetchNewDocketEntries', + "additionalPageArray": [CaseUpdatePacerOptionsAdditionalPageArrayInner.from_dict(_item) for _item in obj["additionalPageArray"]] if obj.get("additionalPageArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.pacer_user_id = pacer_user_id - self.pacer_client_code = pacer_client_code - self.fetch_participants_if_older_than_days = fetch_participants_if_older_than_days - self.refresh_type = refresh_type - self.additional_page_array = additional_page_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_update_preview.py b/unicourt/model/case_update_preview.py index bf069ba..9562e4b 100644 --- a/unicourt/model/case_update_preview.py +++ b/unicourt/model/case_update_preview.py @@ -1,341 +1,119 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_update_pacer_options_response import CaseUpdatePacerOptionsResponse - from unicourt.model.exception import Exception - globals()['CaseUpdatePacerOptionsResponse'] = CaseUpdatePacerOptionsResponse - globals()['Exception'] = Exception - - -class CaseUpdatePreview(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('status',): { - 'COMPLETE': "COMPLETE", - 'FAILURE': "FAILURE", - 'IN_PROGRESS': "IN_PROGRESS", - 'DELAYED': "DELAYED", - }, - } - - validations = { - ('object',): { - 'max_length': 17, - 'min_length': 17, - }, - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('status',): { - 'max_length': 11, - 'min_length': 7, - }, - ('requested_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('case_api',): { - 'max_length': 255, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_id': (str,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'requested_date': (datetime,), # noqa: E501 - 'case_api': (str,), # noqa: E501 - 'pacer_options': (CaseUpdatePacerOptionsResponse,), # noqa: E501 - 'exception': (Exception,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_id': 'caseId', # noqa: E501 - 'status': 'status', # noqa: E501 - 'requested_date': 'requestedDate', # noqa: E501 - 'case_api': 'caseAPI', # noqa: E501 - 'pacer_options': 'pacerOptions', # noqa: E501 - 'exception': 'exception', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_update_pacer_options_response import CaseUpdatePacerOptionsResponse +from unicourt.model.exception import Exception +from typing import Optional, Set +from typing_extensions import Self + +class CaseUpdatePreview(BaseModel): + """ + CaseUpdatePreview + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=17)]] = Field(default='CaseUpdatePreview', description="Name of the object.") + case_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Unique Id for a Case in UniCourt.", alias="caseId") + status: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]] = Field(default=None, description="Status of the request.") + requested_date: Optional[datetime] = Field(default=None, description="The date and time when the case was last requested for update ", alias="requestedDate") + case_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="caseAPI") + pacer_options: Optional[CaseUpdatePacerOptionsResponse] = Field(default=None, alias="pacerOptions") + exception: Optional[Exception] = None + __properties: ClassVar[List[str]] = ["object", "caseId", "status", "requestedDate", "caseAPI", "pacerOptions", "exception"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['COMPLETE', 'FAILURE', 'IN_PROGRESS', 'DELAYED']): + raise ValueError("must be one of enum values ('COMPLETE', 'FAILURE', 'IN_PROGRESS', 'DELAYED')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_id, status, requested_date, case_api, pacer_options, exception, *args, **kwargs): # noqa: E501 - """CaseUpdatePreview - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseUpdatePreview from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - case_id (str): Unique Id for a Case in UniCourt. - status (str): Status of the request. - requested_date (datetime): The date and time when the case was last requested for update - case_api (str): - pacer_options (CaseUpdatePacerOptionsResponse): - exception (Exception): - - Keyword Args: - object (str): Name of the object.. defaults to "CaseUpdatePreview" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "CaseUpdatePreview") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_id = case_id - self.status = status - self.requested_date = requested_date - self.case_api = case_api - self.pacer_options = pacer_options - self.exception = exception - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_id, status, requested_date, case_api, pacer_options, exception, *args, **kwargs): # noqa: E501 - """CaseUpdatePreview - a model defined in OpenAPI - - Args: - case_id (str): Unique Id for a Case in UniCourt. - status (str): Status of the request. - requested_date (datetime): The date and time when the case was last requested for update - case_api (str): - pacer_options (CaseUpdatePacerOptionsResponse): - exception (Exception): - - Keyword Args: - object (str): Name of the object.. defaults to "CaseUpdatePreview" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pacer_options + if self.pacer_options: + _dict['pacerOptions'] = self.pacer_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of exception + if self.exception: + _dict['exception'] = self.exception.to_dict() + return _dict - object = kwargs.get('object', "CaseUpdatePreview") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseUpdatePreview from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CaseUpdatePreview', + "caseId": obj.get("caseId"), + "status": obj.get("status"), + "requestedDate": obj.get("requestedDate"), + "caseAPI": obj.get("caseAPI"), + "pacerOptions": CaseUpdatePacerOptionsResponse.from_dict(obj["pacerOptions"]) if obj.get("pacerOptions") is not None else None, + "exception": Exception.from_dict(obj["exception"]) if obj.get("exception") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_id = case_id - self.status = status - self.requested_date = requested_date - self.case_api = case_api - self.pacer_options = pacer_options - self.exception = exception - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/case_update_request.py b/unicourt/model/case_update_request.py index 2c1797d..b180e01 100644 --- a/unicourt/model/case_update_request.py +++ b/unicourt/model/case_update_request.py @@ -1,283 +1,94 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_update_pacer_options import CaseUpdatePacerOptions - globals()['CaseUpdatePacerOptions'] = CaseUpdatePacerOptions - - -class CaseUpdateRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'case_id': (str,), # noqa: E501 - 'pacer_options': (CaseUpdatePacerOptions,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_update_pacer_options import CaseUpdatePacerOptions +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class CaseUpdateRequest(BaseModel): + """ + CaseUpdateRequest + """ # noqa: E501 + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18)] = Field(description="UniCourt's Case Id for update.", alias="caseId") + pacer_options: Optional[CaseUpdatePacerOptions] = Field(default=None, alias="pacerOptions") + __properties: ClassVar[List[str]] = ["caseId", "pacerOptions"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'case_id': 'caseId', # noqa: E501 - 'pacer_options': 'pacerOptions', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_id, *args, **kwargs): # noqa: E501 - """CaseUpdateRequest - a model defined in OpenAPI - - Args: - case_id (str): UniCourt's Case Id for update. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - pacer_options (CaseUpdatePacerOptions): [optional] # noqa: E501 - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CaseUpdateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.case_id = case_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_id, *args, **kwargs): # noqa: E501 - """CaseUpdateRequest - a model defined in OpenAPI - - Args: - case_id (str): UniCourt's Case Id for update. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - pacer_options (CaseUpdatePacerOptions): [optional] # noqa: E501 + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pacer_options + if self.pacer_options: + _dict['pacerOptions'] = self.pacer_options.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CaseUpdateRequest from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "caseId": obj.get("caseId"), + "pacerOptions": CaseUpdatePacerOptions.from_dict(obj["pacerOptions"]) if obj.get("pacerOptions") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.case_id = case_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/cause_of_action.py b/unicourt/model/cause_of_action.py index 4b06ecd..9fa0d2f 100644 --- a/unicourt/model/cause_of_action.py +++ b/unicourt/model/cause_of_action.py @@ -1,325 +1,99 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CauseOfAction(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CauseOfAction(BaseModel): """ + CauseOfAction + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=13, strict=True, max_length=13)]] = 'CauseOfAction' + cause_of_action_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="causeOfActionId") + cause_of_action_group_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="causeOfActionGroupId") + cause_of_action_group: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="causeOfActionGroup") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "causeOfActionId", "causeOfActionGroupId", "causeOfActionGroup", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 13, - 'min_length': 13, - }, - ('cause_of_action_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('cause_of_action_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('cause_of_action_group',): { - 'max_length': 255, - 'min_length': 1, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CauseOfAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'cause_of_action_id': (str,), # noqa: E501 - 'cause_of_action_group_id': (str,), # noqa: E501 - 'cause_of_action_group': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'cause_of_action_id': 'causeOfActionId', # noqa: E501 - 'cause_of_action_group_id': 'causeOfActionGroupId', # noqa: E501 - 'cause_of_action_group': 'causeOfActionGroup', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, cause_of_action_id, cause_of_action_group_id, cause_of_action_group, name, created_date, *args, **kwargs): # noqa: E501 - """CauseOfAction - a model defined in OpenAPI - - Args: - cause_of_action_id (str): - cause_of_action_group_id (str): - cause_of_action_group (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CauseOfAction" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CauseOfAction") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.cause_of_action_id = cause_of_action_id - self.cause_of_action_group_id = cause_of_action_group_id - self.cause_of_action_group = cause_of_action_group - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, cause_of_action_id, cause_of_action_group_id, cause_of_action_group, name, created_date, *args, **kwargs): # noqa: E501 - """CauseOfAction - a model defined in OpenAPI - - Args: - cause_of_action_id (str): - cause_of_action_group_id (str): - cause_of_action_group (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CauseOfAction" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CauseOfAction from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CauseOfAction") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CauseOfAction', + "causeOfActionId": obj.get("causeOfActionId"), + "causeOfActionGroupId": obj.get("causeOfActionGroupId"), + "causeOfActionGroup": obj.get("causeOfActionGroup"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.cause_of_action_id = cause_of_action_id - self.cause_of_action_group_id = cause_of_action_group_id - self.cause_of_action_group = cause_of_action_group - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/cause_of_action_additional_data.py b/unicourt/model/cause_of_action_additional_data.py index e4be0f2..7d1e54b 100644 --- a/unicourt/model/cause_of_action_additional_data.py +++ b/unicourt/model/cause_of_action_additional_data.py @@ -1,315 +1,97 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CauseOfActionAdditionalData(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CauseOfActionAdditionalData(BaseModel): """ + CauseOfActionAdditionalData + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=27, strict=True, max_length=27)]] = 'CauseOfActionAdditionalData' + cause_of_action_additional_data_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="causeOfActionAdditionalDataId") + type: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + value: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "causeOfActionAdditionalDataId", "type", "value", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 27, - 'min_length': 27, - }, - ('cause_of_action_additional_data_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('type',): { - 'max_length': 255, - 'min_length': 1, - }, - ('value',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CauseOfActionAdditionalData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'cause_of_action_additional_data_id': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'cause_of_action_additional_data_id': 'causeOfActionAdditionalDataId', # noqa: E501 - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, cause_of_action_additional_data_id, type, value, created_date, *args, **kwargs): # noqa: E501 - """CauseOfActionAdditionalData - a model defined in OpenAPI - - Args: - cause_of_action_additional_data_id (str): - type (str): - value (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CauseOfActionAdditionalData" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CauseOfActionAdditionalData") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.cause_of_action_additional_data_id = cause_of_action_additional_data_id - self.type = type - self.value = value - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, cause_of_action_additional_data_id, type, value, created_date, *args, **kwargs): # noqa: E501 - """CauseOfActionAdditionalData - a model defined in OpenAPI - - Args: - cause_of_action_additional_data_id (str): - type (str): - value (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CauseOfActionAdditionalData" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CauseOfActionAdditionalData from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CauseOfActionAdditionalData") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CauseOfActionAdditionalData', + "causeOfActionAdditionalDataId": obj.get("causeOfActionAdditionalDataId"), + "type": obj.get("type"), + "value": obj.get("value"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.cause_of_action_additional_data_id = cause_of_action_additional_data_id - self.type = type - self.value = value - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/cause_of_action_additional_data_response.py b/unicourt/model/cause_of_action_additional_data_response.py index 8075a2e..3c2484f 100644 --- a/unicourt/model/cause_of_action_additional_data_response.py +++ b/unicourt/model/cause_of_action_additional_data_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.cause_of_action_additional_data import CauseOfActionAdditionalData - globals()['CauseOfActionAdditionalData'] = CauseOfActionAdditionalData - - -class CauseOfActionAdditionalDataResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 35, - 'min_length': 35, - }, - ('cause_of_action_additional_data_array',): { - }, - ('next_page_api',): { - 'max_length': 2160, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2159, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'cause_of_action_additional_data_array': ([CauseOfActionAdditionalData],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'cause_of_action_additional_data_array': 'causeOfActionAdditionalDataArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.cause_of_action_additional_data import CauseOfActionAdditionalData +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CauseOfActionAdditionalDataResponse(BaseModel): + """ + CauseOfActionAdditionalDataResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=35, strict=True, max_length=35)]] = 'CauseOfActionAdditionalDataResponse' + cause_of_action_additional_data_array: Optional[List[CauseOfActionAdditionalData]] = Field(default=None, alias="causeOfActionAdditionalDataArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2160)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2159)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "causeOfActionAdditionalDataArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, cause_of_action_additional_data_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CauseOfActionAdditionalDataResponse - a model defined in OpenAPI - - Args: - cause_of_action_additional_data_array ([CauseOfActionAdditionalData]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CauseOfActionAdditionalDataResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CauseOfActionAdditionalDataResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CauseOfActionAdditionalDataResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.cause_of_action_additional_data_array = cause_of_action_additional_data_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, cause_of_action_additional_data_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CauseOfActionAdditionalDataResponse - a model defined in OpenAPI - - Args: - cause_of_action_additional_data_array ([CauseOfActionAdditionalData]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CauseOfActionAdditionalDataResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in cause_of_action_additional_data_array (list) + _items = [] + if self.cause_of_action_additional_data_array: + for _item in self.cause_of_action_additional_data_array: + if _item: + _items.append(_item.to_dict()) + _dict['causeOfActionAdditionalDataArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CauseOfActionAdditionalDataResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CauseOfActionAdditionalDataResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CauseOfActionAdditionalDataResponse', + "causeOfActionAdditionalDataArray": [CauseOfActionAdditionalData.from_dict(_item) for _item in obj["causeOfActionAdditionalDataArray"]] if obj.get("causeOfActionAdditionalDataArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.cause_of_action_additional_data_array = cause_of_action_additional_data_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/cause_of_action_group.py b/unicourt/model/cause_of_action_group.py index 95ef922..5763d77 100644 --- a/unicourt/model/cause_of_action_group.py +++ b/unicourt/model/cause_of_action_group.py @@ -1,305 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CauseOfActionGroup(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CauseOfActionGroup(BaseModel): """ + CauseOfActionGroup + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = 'CauseOfActionGroup' + cause_of_action_group_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="causeOfActionGroupId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "causeOfActionGroupId", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 18, - 'min_length': 18, - }, - ('cause_of_action_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CauseOfActionGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'cause_of_action_group_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'cause_of_action_group_id': 'causeOfActionGroupId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, cause_of_action_group_id, name, created_date, *args, **kwargs): # noqa: E501 - """CauseOfActionGroup - a model defined in OpenAPI - - Args: - cause_of_action_group_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CauseOfActionGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CauseOfActionGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.cause_of_action_group_id = cause_of_action_group_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, cause_of_action_group_id, name, created_date, *args, **kwargs): # noqa: E501 - """CauseOfActionGroup - a model defined in OpenAPI - - Args: - cause_of_action_group_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CauseOfActionGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CauseOfActionGroup from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CauseOfActionGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CauseOfActionGroup', + "causeOfActionGroupId": obj.get("causeOfActionGroupId"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.cause_of_action_group_id = cause_of_action_group_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/cause_of_action_group_response.py b/unicourt/model/cause_of_action_group_response.py index 6e30d58..7ee8ee7 100644 --- a/unicourt/model/cause_of_action_group_response.py +++ b/unicourt/model/cause_of_action_group_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.cause_of_action_group import CauseOfActionGroup - globals()['CauseOfActionGroup'] = CauseOfActionGroup - - -class CauseOfActionGroupResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 26, - 'min_length': 26, - }, - ('cause_of_action_group_array',): { - }, - ('next_page_api',): { - 'max_length': 2151, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2150, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'cause_of_action_group_array': ([CauseOfActionGroup],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'cause_of_action_group_array': 'causeOfActionGroupArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.cause_of_action_group import CauseOfActionGroup +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CauseOfActionGroupResponse(BaseModel): + """ + CauseOfActionGroupResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=26, strict=True, max_length=26)]] = 'CauseOfActionGroupResponse' + cause_of_action_group_array: Optional[List[CauseOfActionGroup]] = Field(default=None, alias="causeOfActionGroupArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2151)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2150)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "causeOfActionGroupArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, cause_of_action_group_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CauseOfActionGroupResponse - a model defined in OpenAPI - - Args: - cause_of_action_group_array ([CauseOfActionGroup]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CauseOfActionGroupResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CauseOfActionGroupResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CauseOfActionGroupResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.cause_of_action_group_array = cause_of_action_group_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, cause_of_action_group_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CauseOfActionGroupResponse - a model defined in OpenAPI - - Args: - cause_of_action_group_array ([CauseOfActionGroup]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CauseOfActionGroupResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in cause_of_action_group_array (list) + _items = [] + if self.cause_of_action_group_array: + for _item in self.cause_of_action_group_array: + if _item: + _items.append(_item.to_dict()) + _dict['causeOfActionGroupArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CauseOfActionGroupResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CauseOfActionGroupResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CauseOfActionGroupResponse', + "causeOfActionGroupArray": [CauseOfActionGroup.from_dict(_item) for _item in obj["causeOfActionGroupArray"]] if obj.get("causeOfActionGroupArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.cause_of_action_group_array = cause_of_action_group_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/cause_of_action_response.py b/unicourt/model/cause_of_action_response.py index f3a657e..d745a01 100644 --- a/unicourt/model/cause_of_action_response.py +++ b/unicourt/model/cause_of_action_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.cause_of_action import CauseOfAction - globals()['CauseOfAction'] = CauseOfAction - - -class CauseOfActionResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 21, - 'min_length': 21, - }, - ('cause_of_action_array',): { - }, - ('next_page_api',): { - 'max_length': 2146, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2145, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'cause_of_action_array': ([CauseOfAction],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'cause_of_action_array': 'causeOfActionArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.cause_of_action import CauseOfAction +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CauseOfActionResponse(BaseModel): + """ + CauseOfActionResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=21, strict=True, max_length=21)]] = 'CauseOfActionResponse' + cause_of_action_array: Optional[List[CauseOfAction]] = Field(default=None, alias="causeOfActionArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2146)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2145)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "causeOfActionArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, cause_of_action_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CauseOfActionResponse - a model defined in OpenAPI - - Args: - cause_of_action_array ([CauseOfAction]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CauseOfActionResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CauseOfActionResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CauseOfActionResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.cause_of_action_array = cause_of_action_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, cause_of_action_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CauseOfActionResponse - a model defined in OpenAPI - - Args: - cause_of_action_array ([CauseOfAction]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CauseOfActionResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in cause_of_action_array (list) + _items = [] + if self.cause_of_action_array: + for _item in self.cause_of_action_array: + if _item: + _items.append(_item.to_dict()) + _dict['causeOfActionArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CauseOfActionResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CauseOfActionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CauseOfActionResponse', + "causeOfActionArray": [CauseOfAction.from_dict(_item) for _item in obj["causeOfActionArray"]] if obj.get("causeOfActionArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.cause_of_action_array = cause_of_action_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/charge.py b/unicourt/model/charge.py index 14615e2..0c9b4f8 100644 --- a/unicourt/model/charge.py +++ b/unicourt/model/charge.py @@ -1,325 +1,99 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class Charge(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class Charge(BaseModel): """ + Charge + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=6, strict=True, max_length=6)]] = 'Charge' + charge_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="chargeId") + charge_group_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="chargeGroupId") + charge_group: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="chargeGroup") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "chargeId", "chargeGroupId", "chargeGroup", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 6, - 'min_length': 6, - }, - ('charge_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('charge_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('charge_group',): { - 'max_length': 255, - 'min_length': 1, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Charge from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'charge_id': (str,), # noqa: E501 - 'charge_group_id': (str,), # noqa: E501 - 'charge_group': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'charge_id': 'chargeId', # noqa: E501 - 'charge_group_id': 'chargeGroupId', # noqa: E501 - 'charge_group': 'chargeGroup', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, charge_id, charge_group_id, charge_group, name, created_date, *args, **kwargs): # noqa: E501 - """Charge - a model defined in OpenAPI - - Args: - charge_id (str): - charge_group_id (str): - charge_group (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "Charge" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "Charge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.charge_id = charge_id - self.charge_group_id = charge_group_id - self.charge_group = charge_group - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, charge_id, charge_group_id, charge_group, name, created_date, *args, **kwargs): # noqa: E501 - """Charge - a model defined in OpenAPI - - Args: - charge_id (str): - charge_group_id (str): - charge_group (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "Charge" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Charge from a dict""" + if obj is None: + return None - object = kwargs.get('object', "Charge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Charge', + "chargeId": obj.get("chargeId"), + "chargeGroupId": obj.get("chargeGroupId"), + "chargeGroup": obj.get("chargeGroup"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.charge_id = charge_id - self.charge_group_id = charge_group_id - self.charge_group = charge_group - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/charge_additional_data.py b/unicourt/model/charge_additional_data.py index c4062cb..f7d04e6 100644 --- a/unicourt/model/charge_additional_data.py +++ b/unicourt/model/charge_additional_data.py @@ -1,315 +1,97 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class ChargeAdditionalData(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class ChargeAdditionalData(BaseModel): """ + ChargeAdditionalData + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=20, strict=True, max_length=20)]] = 'ChargeAdditionalData' + charge_additional_data_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="chargeAdditionalDataId") + type: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + value: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "chargeAdditionalDataId", "type", "value", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 20, - 'min_length': 20, - }, - ('charge_additional_data_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('type',): { - 'max_length': 255, - 'min_length': 1, - }, - ('value',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ChargeAdditionalData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'charge_additional_data_id': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'charge_additional_data_id': 'chargeAdditionalDataId', # noqa: E501 - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, charge_additional_data_id, type, value, created_date, *args, **kwargs): # noqa: E501 - """ChargeAdditionalData - a model defined in OpenAPI - - Args: - charge_additional_data_id (str): - type (str): - value (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "ChargeAdditionalData" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "ChargeAdditionalData") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.charge_additional_data_id = charge_additional_data_id - self.type = type - self.value = value - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, charge_additional_data_id, type, value, created_date, *args, **kwargs): # noqa: E501 - """ChargeAdditionalData - a model defined in OpenAPI - - Args: - charge_additional_data_id (str): - type (str): - value (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "ChargeAdditionalData" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ChargeAdditionalData from a dict""" + if obj is None: + return None - object = kwargs.get('object', "ChargeAdditionalData") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'ChargeAdditionalData', + "chargeAdditionalDataId": obj.get("chargeAdditionalDataId"), + "type": obj.get("type"), + "value": obj.get("value"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.charge_additional_data_id = charge_additional_data_id - self.type = type - self.value = value - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/charge_additional_data_response.py b/unicourt/model/charge_additional_data_response.py index c2cdb3f..6406d96 100644 --- a/unicourt/model/charge_additional_data_response.py +++ b/unicourt/model/charge_additional_data_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.charge_additional_data import ChargeAdditionalData - globals()['ChargeAdditionalData'] = ChargeAdditionalData - - -class ChargeAdditionalDataResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 28, - 'min_length': 28, - }, - ('charge_additional_data_array',): { - }, - ('next_page_api',): { - 'max_length': 2153, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2152, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'charge_additional_data_array': ([ChargeAdditionalData],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'charge_additional_data_array': 'chargeAdditionalDataArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.charge_additional_data import ChargeAdditionalData +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class ChargeAdditionalDataResponse(BaseModel): + """ + ChargeAdditionalDataResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=28, strict=True, max_length=28)]] = 'ChargeAdditionalDataResponse' + charge_additional_data_array: Optional[List[ChargeAdditionalData]] = Field(default=None, alias="chargeAdditionalDataArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2153)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2152)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "chargeAdditionalDataArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, charge_additional_data_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """ChargeAdditionalDataResponse - a model defined in OpenAPI - - Args: - charge_additional_data_array ([ChargeAdditionalData]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "ChargeAdditionalDataResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "ChargeAdditionalDataResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ChargeAdditionalDataResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.charge_additional_data_array = charge_additional_data_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, charge_additional_data_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """ChargeAdditionalDataResponse - a model defined in OpenAPI - - Args: - charge_additional_data_array ([ChargeAdditionalData]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "ChargeAdditionalDataResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in charge_additional_data_array (list) + _items = [] + if self.charge_additional_data_array: + for _item in self.charge_additional_data_array: + if _item: + _items.append(_item.to_dict()) + _dict['chargeAdditionalDataArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "ChargeAdditionalDataResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ChargeAdditionalDataResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'ChargeAdditionalDataResponse', + "chargeAdditionalDataArray": [ChargeAdditionalData.from_dict(_item) for _item in obj["chargeAdditionalDataArray"]] if obj.get("chargeAdditionalDataArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.charge_additional_data_array = charge_additional_data_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/charge_degree.py b/unicourt/model/charge_degree.py index 169d201..fb77528 100644 --- a/unicourt/model/charge_degree.py +++ b/unicourt/model/charge_degree.py @@ -1,305 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class ChargeDegree(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class ChargeDegree(BaseModel): """ + ChargeDegree + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=12, strict=True, max_length=12)]] = 'ChargeDegree' + charge_degree_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="chargeDegreeId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "chargeDegreeId", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 12, - 'min_length': 12, - }, - ('charge_degree_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ChargeDegree from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'charge_degree_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'charge_degree_id': 'chargeDegreeId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, charge_degree_id, name, created_date, *args, **kwargs): # noqa: E501 - """ChargeDegree - a model defined in OpenAPI - - Args: - charge_degree_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "ChargeDegree" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "ChargeDegree") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.charge_degree_id = charge_degree_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, charge_degree_id, name, created_date, *args, **kwargs): # noqa: E501 - """ChargeDegree - a model defined in OpenAPI - - Args: - charge_degree_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "ChargeDegree" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ChargeDegree from a dict""" + if obj is None: + return None - object = kwargs.get('object', "ChargeDegree") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'ChargeDegree', + "chargeDegreeId": obj.get("chargeDegreeId"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.charge_degree_id = charge_degree_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/charge_degree_response.py b/unicourt/model/charge_degree_response.py index 34e3dd6..7db7a5a 100644 --- a/unicourt/model/charge_degree_response.py +++ b/unicourt/model/charge_degree_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.charge_degree import ChargeDegree - globals()['ChargeDegree'] = ChargeDegree - - -class ChargeDegreeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 20, - 'min_length': 20, - }, - ('charge_degree_array',): { - }, - ('next_page_api',): { - 'max_length': 2160, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2159, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'charge_degree_array': ([ChargeDegree],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'charge_degree_array': 'chargeDegreeArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.charge_degree import ChargeDegree +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class ChargeDegreeResponse(BaseModel): + """ + ChargeDegreeResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=20, strict=True, max_length=20)]] = 'ChargeDegreeResponse' + charge_degree_array: Optional[List[ChargeDegree]] = Field(default=None, alias="chargeDegreeArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2160)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2159)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "chargeDegreeArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, charge_degree_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """ChargeDegreeResponse - a model defined in OpenAPI - - Args: - charge_degree_array ([ChargeDegree]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "ChargeDegreeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "ChargeDegreeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ChargeDegreeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.charge_degree_array = charge_degree_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, charge_degree_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """ChargeDegreeResponse - a model defined in OpenAPI - - Args: - charge_degree_array ([ChargeDegree]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "ChargeDegreeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in charge_degree_array (list) + _items = [] + if self.charge_degree_array: + for _item in self.charge_degree_array: + if _item: + _items.append(_item.to_dict()) + _dict['chargeDegreeArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "ChargeDegreeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ChargeDegreeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'ChargeDegreeResponse', + "chargeDegreeArray": [ChargeDegree.from_dict(_item) for _item in obj["chargeDegreeArray"]] if obj.get("chargeDegreeArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.charge_degree_array = charge_degree_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/charge_group.py b/unicourt/model/charge_group.py index 8a05f75..c2207d9 100644 --- a/unicourt/model/charge_group.py +++ b/unicourt/model/charge_group.py @@ -1,305 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class ChargeGroup(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class ChargeGroup(BaseModel): """ + ChargeGroup + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=11, strict=True, max_length=11)]] = 'ChargeGroup' + charge_group_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="chargeGroupId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "chargeGroupId", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 11, - 'min_length': 11, - }, - ('charge_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ChargeGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'charge_group_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'charge_group_id': 'chargeGroupId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, charge_group_id, name, created_date, *args, **kwargs): # noqa: E501 - """ChargeGroup - a model defined in OpenAPI - - Args: - charge_group_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "ChargeGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "ChargeGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.charge_group_id = charge_group_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, charge_group_id, name, created_date, *args, **kwargs): # noqa: E501 - """ChargeGroup - a model defined in OpenAPI - - Args: - charge_group_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "ChargeGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ChargeGroup from a dict""" + if obj is None: + return None - object = kwargs.get('object', "ChargeGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'ChargeGroup', + "chargeGroupId": obj.get("chargeGroupId"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.charge_group_id = charge_group_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/charge_group_response.py b/unicourt/model/charge_group_response.py index a6bace0..649198c 100644 --- a/unicourt/model/charge_group_response.py +++ b/unicourt/model/charge_group_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.charge_group import ChargeGroup - globals()['ChargeGroup'] = ChargeGroup - - -class ChargeGroupResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 19, - 'min_length': 19, - }, - ('charge_group_array',): { - }, - ('next_page_api',): { - 'max_length': 2142, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2141, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'charge_group_array': ([ChargeGroup],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'charge_group_array': 'chargeGroupArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.charge_group import ChargeGroup +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class ChargeGroupResponse(BaseModel): + """ + ChargeGroupResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=19, strict=True, max_length=19)]] = 'ChargeGroupResponse' + charge_group_array: Optional[List[ChargeGroup]] = Field(default=None, alias="chargeGroupArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2142)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2141)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "chargeGroupArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, charge_group_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """ChargeGroupResponse - a model defined in OpenAPI - - Args: - charge_group_array ([ChargeGroup]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "ChargeGroupResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "ChargeGroupResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ChargeGroupResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.charge_group_array = charge_group_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, charge_group_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """ChargeGroupResponse - a model defined in OpenAPI - - Args: - charge_group_array ([ChargeGroup]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "ChargeGroupResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in charge_group_array (list) + _items = [] + if self.charge_group_array: + for _item in self.charge_group_array: + if _item: + _items.append(_item.to_dict()) + _dict['chargeGroupArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "ChargeGroupResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ChargeGroupResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'ChargeGroupResponse', + "chargeGroupArray": [ChargeGroup.from_dict(_item) for _item in obj["chargeGroupArray"]] if obj.get("chargeGroupArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.charge_group_array = charge_group_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/charge_response.py b/unicourt/model/charge_response.py index 594f55d..903a838 100644 --- a/unicourt/model/charge_response.py +++ b/unicourt/model/charge_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.charge import Charge - globals()['Charge'] = Charge - - -class ChargeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 14, - 'min_length': 14, - }, - ('charge_array',): { - }, - ('next_page_api',): { - 'max_length': 2137, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2136, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'charge_array': ([Charge],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'charge_array': 'chargeArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.charge import Charge +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class ChargeResponse(BaseModel): + """ + ChargeResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=14, strict=True, max_length=14)]] = 'ChargeResponse' + charge_array: Optional[List[Charge]] = Field(default=None, alias="chargeArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2137)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2136)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "chargeArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, charge_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """ChargeResponse - a model defined in OpenAPI - - Args: - charge_array ([Charge]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "ChargeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "ChargeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ChargeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.charge_array = charge_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, charge_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """ChargeResponse - a model defined in OpenAPI - - Args: - charge_array ([Charge]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "ChargeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in charge_array (list) + _items = [] + if self.charge_array: + for _item in self.charge_array: + if _item: + _items.append(_item.to_dict()) + _dict['chargeArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "ChargeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ChargeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'ChargeResponse', + "chargeArray": [Charge.from_dict(_item) for _item in obj["chargeArray"]] if obj.get("chargeArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.charge_array = charge_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/charge_severity.py b/unicourt/model/charge_severity.py index 54e6c58..5952bf0 100644 --- a/unicourt/model/charge_severity.py +++ b/unicourt/model/charge_severity.py @@ -1,305 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class ChargeSeverity(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class ChargeSeverity(BaseModel): """ + ChargeSeverity + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=14, strict=True, max_length=14)]] = 'ChargeSeverity' + charge_severity_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="chargeSeverityId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "chargeSeverityId", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 14, - 'min_length': 14, - }, - ('charge_severity_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ChargeSeverity from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'charge_severity_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'charge_severity_id': 'chargeSeverityId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, charge_severity_id, name, created_date, *args, **kwargs): # noqa: E501 - """ChargeSeverity - a model defined in OpenAPI - - Args: - charge_severity_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "ChargeSeverity" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "ChargeSeverity") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.charge_severity_id = charge_severity_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, charge_severity_id, name, created_date, *args, **kwargs): # noqa: E501 - """ChargeSeverity - a model defined in OpenAPI - - Args: - charge_severity_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "ChargeSeverity" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ChargeSeverity from a dict""" + if obj is None: + return None - object = kwargs.get('object', "ChargeSeverity") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'ChargeSeverity', + "chargeSeverityId": obj.get("chargeSeverityId"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.charge_severity_id = charge_severity_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/charge_severity_response.py b/unicourt/model/charge_severity_response.py index 8fb0b78..5e7d9b9 100644 --- a/unicourt/model/charge_severity_response.py +++ b/unicourt/model/charge_severity_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.charge_severity import ChargeSeverity - globals()['ChargeSeverity'] = ChargeSeverity - - -class ChargeSeverityResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 22, - 'min_length': 22, - }, - ('charge_severity_array',): { - }, - ('next_page_api',): { - 'max_length': 2160, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2159, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'charge_severity_array': ([ChargeSeverity],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'charge_severity_array': 'chargeSeverityArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.charge_severity import ChargeSeverity +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class ChargeSeverityResponse(BaseModel): + """ + ChargeSeverityResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=22, strict=True, max_length=22)]] = 'ChargeSeverityResponse' + charge_severity_array: Optional[List[ChargeSeverity]] = Field(default=None, alias="chargeSeverityArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2160)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2159)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "chargeSeverityArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, charge_severity_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """ChargeSeverityResponse - a model defined in OpenAPI - - Args: - charge_severity_array ([ChargeSeverity]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "ChargeSeverityResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "ChargeSeverityResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ChargeSeverityResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.charge_severity_array = charge_severity_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, charge_severity_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """ChargeSeverityResponse - a model defined in OpenAPI - - Args: - charge_severity_array ([ChargeSeverity]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "ChargeSeverityResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in charge_severity_array (list) + _items = [] + if self.charge_severity_array: + for _item in self.charge_severity_array: + if _item: + _items.append(_item.to_dict()) + _dict['chargeSeverityArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "ChargeSeverityResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ChargeSeverityResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'ChargeSeverityResponse', + "chargeSeverityArray": [ChargeSeverity.from_dict(_item) for _item in obj["chargeSeverityArray"]] if obj.get("chargeSeverityArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.charge_severity_array = charge_severity_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/contact.py b/unicourt/model/contact.py index 77d72a8..a4e7692 100644 --- a/unicourt/model/contact.py +++ b/unicourt/model/contact.py @@ -1,303 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.address import Address - from unicourt.model.email import Email - from unicourt.model.phone import Phone - globals()['Address'] = Address - globals()['Email'] = Email - globals()['Phone'] = Phone - - -class Contact(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - validations = { - ('object',): { - 'max_length': 7, - 'min_length': 7, - }, - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.address import Address +from unicourt.model.email import Email +from unicourt.model.phone import Phone +from typing import Optional, Set +from typing_extensions import Self + +class Contact(BaseModel): + """ + Contact object data schema. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=7)]] = 'Contact' + address_array: Optional[List[Address]] = Field(default=None, description="List of available addresses.", alias="addressArray") + phone_number_array: Optional[List[Phone]] = Field(default=None, description="List of available phone numbers.", alias="phoneNumberArray") + email_array: Optional[List[Email]] = Field(default=None, description="List of available emails.", alias="emailArray") + __properties: ClassVar[List[str]] = ["object", "addressArray", "phoneNumberArray", "emailArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Contact from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'address_array': ([Address], none_type,), # noqa: E501 - 'phone_number_array': ([Phone], none_type,), # noqa: E501 - 'email_array': ([Email], none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'address_array': 'addressArray', # noqa: E501 - 'phone_number_array': 'phoneNumberArray', # noqa: E501 - 'email_array': 'emailArray', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in address_array (list) + _items = [] + if self.address_array: + for _item in self.address_array: + if _item: + _items.append(_item.to_dict()) + _dict['addressArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in phone_number_array (list) + _items = [] + if self.phone_number_array: + for _item in self.phone_number_array: + if _item: + _items.append(_item.to_dict()) + _dict['phoneNumberArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in email_array (list) + _items = [] + if self.email_array: + for _item in self.email_array: + if _item: + _items.append(_item.to_dict()) + _dict['emailArray'] = _items + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, address_array, phone_number_array, email_array, *args, **kwargs): # noqa: E501 - """Contact - a model defined in OpenAPI - - Args: - address_array ([Address], none_type): List of available addresses. - phone_number_array ([Phone], none_type): List of available phone numbers. - email_array ([Email], none_type): List of available emails. - - Keyword Args: - object (str): defaults to "Contact" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "Contact") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.address_array = address_array - self.phone_number_array = phone_number_array - self.email_array = email_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, address_array, phone_number_array, email_array, *args, **kwargs): # noqa: E501 - """Contact - a model defined in OpenAPI - - Args: - address_array ([Address], none_type): List of available addresses. - phone_number_array ([Phone], none_type): List of available phone numbers. - email_array ([Email], none_type): List of available emails. - - Keyword Args: - object (str): defaults to "Contact" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Contact from a dict""" + if obj is None: + return None - object = kwargs.get('object', "Contact") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Contact', + "addressArray": [Address.from_dict(_item) for _item in obj["addressArray"]] if obj.get("addressArray") is not None else None, + "phoneNumberArray": [Phone.from_dict(_item) for _item in obj["phoneNumberArray"]] if obj.get("phoneNumberArray") is not None else None, + "emailArray": [Email.from_dict(_item) for _item in obj["emailArray"]] if obj.get("emailArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.address_array = address_array - self.phone_number_array = phone_number_array - self.email_array = email_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/court.py b/unicourt/model/court.py index c29b449..3bbad91 100644 --- a/unicourt/model/court.py +++ b/unicourt/model/court.py @@ -1,427 +1,153 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.additional_levels import AdditionalLevels - globals()['AdditionalLevels'] = AdditionalLevels - - -class Court(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 5, - 'min_length': 5, - }, - ('court_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('court_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('court_system_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('type',): { - 'max_length': 255, - 'min_length': 1, - }, - ('system',): { - 'max_length': 255, - 'min_length': 1, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('name_aka',): { - 'max_length': 255, - 'min_length': 1, - }, - ('container_type',): { - 'max_length': 255, - 'min_length': 1, - }, - ('container',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('jurisdiction_geo_for_court_api',): { - 'max_length': 255, - 'min_length': 1, - }, - ('court_locations_for_court_api',): { - 'max_length': 255, - 'min_length': 1, - }, - ('appeal_courts_for_court_api',): { - 'max_length': 255, - 'min_length': 1, - }, - ('court_service_status_api',): { - 'max_length': 2048, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'court_id': (str,), # noqa: E501 - 'court_type_id': (str,), # noqa: E501 - 'court_system_id': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'system': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'name_aka': (str,), # noqa: E501 - 'additional_levels': (AdditionalLevels,), # noqa: E501 - 'container_type': (str, none_type,), # noqa: E501 - 'container': (str, none_type,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - 'jurisdiction_geo_for_court_api': (str, none_type,), # noqa: E501 - 'court_locations_for_court_api': (str, none_type,), # noqa: E501 - 'appeal_courts_for_court_api': (str, none_type,), # noqa: E501 - 'court_service_status_api': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'court_id': 'courtId', # noqa: E501 - 'court_type_id': 'courtTypeId', # noqa: E501 - 'court_system_id': 'courtSystemId', # noqa: E501 - 'type': 'type', # noqa: E501 - 'system': 'system', # noqa: E501 - 'name': 'name', # noqa: E501 - 'name_aka': 'nameAka', # noqa: E501 - 'additional_levels': 'additionalLevels', # noqa: E501 - 'container_type': 'containerType', # noqa: E501 - 'container': 'container', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - 'jurisdiction_geo_for_court_api': 'jurisdictionGeoForCourtAPI', # noqa: E501 - 'court_locations_for_court_api': 'courtLocationsForCourtAPI', # noqa: E501 - 'appeal_courts_for_court_api': 'appealCourtsForCourtAPI', # noqa: E501 - 'court_service_status_api': 'courtServiceStatusAPI', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.additional_levels import AdditionalLevels +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class Court(BaseModel): + """ + Court + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=5, strict=True, max_length=5)]] = 'Court' + court_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="courtId") + court_type_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="courtTypeId") + court_system_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="courtSystemId") + type: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + system: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + name_aka: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="nameAka") + additional_levels: Optional[AdditionalLevels] = Field(default=None, alias="additionalLevels") + container_type: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="containerType") + container: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when the Court was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + jurisdiction_geo_for_court_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="jurisdictionGeoForCourtAPI") + court_locations_for_court_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="courtLocationsForCourtAPI") + appeal_courts_for_court_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="appealCourtsForCourtAPI") + court_service_status_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2048)]] = Field(default=None, alias="courtServiceStatusAPI") + __properties: ClassVar[List[str]] = ["object", "courtId", "courtTypeId", "courtSystemId", "type", "system", "name", "nameAka", "additionalLevels", "containerType", "container", "createdDate", "jurisdictionGeoForCourtAPI", "courtLocationsForCourtAPI", "appealCourtsForCourtAPI", "courtServiceStatusAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, court_id, court_type_id, court_system_id, type, system, name, name_aka, additional_levels, container_type, container, created_date, jurisdiction_geo_for_court_api, court_locations_for_court_api, appeal_courts_for_court_api, court_service_status_api, *args, **kwargs): # noqa: E501 - """Court - a model defined in OpenAPI - - Args: - court_id (str): - court_type_id (str): - court_system_id (str): - type (str): - system (str): - name (str): - name_aka (str): - additional_levels (AdditionalLevels): - container_type (str, none_type): - container (str, none_type): - created_date (datetime): The date and time when the Court was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - jurisdiction_geo_for_court_api (str, none_type): - court_locations_for_court_api (str, none_type): - appeal_courts_for_court_api (str, none_type): - court_service_status_api (str, none_type): - - Keyword Args: - object (str): defaults to "Court" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "Court") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Court from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.court_id = court_id - self.court_type_id = court_type_id - self.court_system_id = court_system_id - self.type = type - self.system = system - self.name = name - self.name_aka = name_aka - self.additional_levels = additional_levels - self.container_type = container_type - self.container = container - self.created_date = created_date - self.jurisdiction_geo_for_court_api = jurisdiction_geo_for_court_api - self.court_locations_for_court_api = court_locations_for_court_api - self.appeal_courts_for_court_api = appeal_courts_for_court_api - self.court_service_status_api = court_service_status_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, court_id, court_type_id, court_system_id, type, system, name, name_aka, additional_levels, container_type, container, created_date, jurisdiction_geo_for_court_api, court_locations_for_court_api, appeal_courts_for_court_api, court_service_status_api, *args, **kwargs): # noqa: E501 - """Court - a model defined in OpenAPI - - Args: - court_id (str): - court_type_id (str): - court_system_id (str): - type (str): - system (str): - name (str): - name_aka (str): - additional_levels (AdditionalLevels): - container_type (str, none_type): - container (str, none_type): - created_date (datetime): The date and time when the Court was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - jurisdiction_geo_for_court_api (str, none_type): - court_locations_for_court_api (str, none_type): - appeal_courts_for_court_api (str, none_type): - court_service_status_api (str, none_type): - - Keyword Args: - object (str): defaults to "Court" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of additional_levels + if self.additional_levels: + _dict['additionalLevels'] = self.additional_levels.to_dict() + # set to None if container_type (nullable) is None + # and model_fields_set contains the field + if self.container_type is None and "container_type" in self.model_fields_set: + _dict['containerType'] = None + + # set to None if container (nullable) is None + # and model_fields_set contains the field + if self.container is None and "container" in self.model_fields_set: + _dict['container'] = None + + # set to None if jurisdiction_geo_for_court_api (nullable) is None + # and model_fields_set contains the field + if self.jurisdiction_geo_for_court_api is None and "jurisdiction_geo_for_court_api" in self.model_fields_set: + _dict['jurisdictionGeoForCourtAPI'] = None + + # set to None if court_locations_for_court_api (nullable) is None + # and model_fields_set contains the field + if self.court_locations_for_court_api is None and "court_locations_for_court_api" in self.model_fields_set: + _dict['courtLocationsForCourtAPI'] = None + + # set to None if appeal_courts_for_court_api (nullable) is None + # and model_fields_set contains the field + if self.appeal_courts_for_court_api is None and "appeal_courts_for_court_api" in self.model_fields_set: + _dict['appealCourtsForCourtAPI'] = None + + # set to None if court_service_status_api (nullable) is None + # and model_fields_set contains the field + if self.court_service_status_api is None and "court_service_status_api" in self.model_fields_set: + _dict['courtServiceStatusAPI'] = None + + return _dict - object = kwargs.get('object', "Court") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Court from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Court', + "courtId": obj.get("courtId"), + "courtTypeId": obj.get("courtTypeId"), + "courtSystemId": obj.get("courtSystemId"), + "type": obj.get("type"), + "system": obj.get("system"), + "name": obj.get("name"), + "nameAka": obj.get("nameAka"), + "additionalLevels": AdditionalLevels.from_dict(obj["additionalLevels"]) if obj.get("additionalLevels") is not None else None, + "containerType": obj.get("containerType"), + "container": obj.get("container"), + "createdDate": obj.get("createdDate"), + "jurisdictionGeoForCourtAPI": obj.get("jurisdictionGeoForCourtAPI"), + "courtLocationsForCourtAPI": obj.get("courtLocationsForCourtAPI"), + "appealCourtsForCourtAPI": obj.get("appealCourtsForCourtAPI"), + "courtServiceStatusAPI": obj.get("courtServiceStatusAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.court_id = court_id - self.court_type_id = court_type_id - self.court_system_id = court_system_id - self.type = type - self.system = system - self.name = name - self.name_aka = name_aka - self.additional_levels = additional_levels - self.container_type = container_type - self.container = container - self.created_date = created_date - self.jurisdiction_geo_for_court_api = jurisdiction_geo_for_court_api - self.court_locations_for_court_api = court_locations_for_court_api - self.appeal_courts_for_court_api = appeal_courts_for_court_api - self.court_service_status_api = court_service_status_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/court_coverage.py b/unicourt/model/court_coverage.py index e7f80db..8327389 100644 --- a/unicourt/model/court_coverage.py +++ b/unicourt/model/court_coverage.py @@ -1,353 +1,122 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_class_coverage import CaseClassCoverage - from unicourt.model.court import Court - globals()['CaseClassCoverage'] = CaseClassCoverage - globals()['Court'] = Court - - -class CourtCoverage(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 13, - 'min_length': 13, - }, - ('last_update_count_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'last_update_count_date': (str,), # noqa: E501 - 'court': (Court,), # noqa: E501 - 'total_case_count': (int,), # noqa: E501 - 'total_cases_in_last_thirty_days_count': (int,), # noqa: E501 - 'total_free_case_document_count': (int,), # noqa: E501 - 'total_free_case_documents_in_last_thirty_days_count': (int,), # noqa: E501 - 'total_paid_case_document_count': (int,), # noqa: E501 - 'total_paid_case_documents_in_last_thirty_days_count': (int,), # noqa: E501 - 'total_case_document_in_library_count': (int,), # noqa: E501 - 'total_case_document_in_library_in_last_thirty_days_count': (int,), # noqa: E501 - 'case_class_coverage_array': ([CaseClassCoverage],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'last_update_count_date': 'lastUpdateCountDate', # noqa: E501 - 'court': 'court', # noqa: E501 - 'total_case_count': 'totalCaseCount', # noqa: E501 - 'total_cases_in_last_thirty_days_count': 'totalCasesInLastThirtyDaysCount', # noqa: E501 - 'total_free_case_document_count': 'totalFreeCaseDocumentCount', # noqa: E501 - 'total_free_case_documents_in_last_thirty_days_count': 'totalFreeCaseDocumentsInLastThirtyDaysCount', # noqa: E501 - 'total_paid_case_document_count': 'totalPaidCaseDocumentCount', # noqa: E501 - 'total_paid_case_documents_in_last_thirty_days_count': 'totalPaidCaseDocumentsInLastThirtyDaysCount', # noqa: E501 - 'total_case_document_in_library_count': 'totalCaseDocumentInLibraryCount', # noqa: E501 - 'total_case_document_in_library_in_last_thirty_days_count': 'totalCaseDocumentInLibraryInLastThirtyDaysCount', # noqa: E501 - 'case_class_coverage_array': 'caseClassCoverageArray', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_class_coverage import CaseClassCoverage +from unicourt.model.court import Court +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CourtCoverage(BaseModel): + """ + CourtCoverage + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=13, strict=True, max_length=13)]] = Field(default='CourtCoverage', description="Name of the object") + last_update_count_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="Date when it was last updated.", alias="lastUpdateCountDate") + court: Optional[Court] = None + total_case_count: Optional[StrictInt] = Field(default=None, description="Total Cases for a specific court.", alias="totalCaseCount") + total_cases_in_last_thirty_days_count: Optional[StrictInt] = Field(default=None, description="Total Cases in last 30 days that were added to UniCourt", alias="totalCasesInLastThirtyDaysCount") + total_free_case_document_count: Optional[StrictInt] = Field(default=None, description="Total Free Case Documents for a specific court.", alias="totalFreeCaseDocumentCount") + total_free_case_documents_in_last_thirty_days_count: Optional[StrictInt] = Field(default=None, description="Total Free Case Documents in last 30 days that were added to UniCourt", alias="totalFreeCaseDocumentsInLastThirtyDaysCount") + total_paid_case_document_count: Optional[StrictInt] = Field(default=None, description="Total Paid Case Documents for a specific court.", alias="totalPaidCaseDocumentCount") + total_paid_case_documents_in_last_thirty_days_count: Optional[StrictInt] = Field(default=None, description="Total Paid Case Documents in last 30 days that were added to UniCourt", alias="totalPaidCaseDocumentsInLastThirtyDaysCount") + total_case_document_in_library_count: Optional[StrictInt] = Field(default=None, description="Count of total Case Documents added in UniCourt Library.", alias="totalCaseDocumentInLibraryCount") + total_case_document_in_library_in_last_thirty_days_count: Optional[StrictInt] = Field(default=None, description="Count of total Case Documents added in UniCourt Library in last 30 days", alias="totalCaseDocumentInLibraryInLastThirtyDaysCount") + case_class_coverage_array: Optional[List[CaseClassCoverage]] = Field(default=None, alias="caseClassCoverageArray") + __properties: ClassVar[List[str]] = ["object", "lastUpdateCountDate", "court", "totalCaseCount", "totalCasesInLastThirtyDaysCount", "totalFreeCaseDocumentCount", "totalFreeCaseDocumentsInLastThirtyDaysCount", "totalPaidCaseDocumentCount", "totalPaidCaseDocumentsInLastThirtyDaysCount", "totalCaseDocumentInLibraryCount", "totalCaseDocumentInLibraryInLastThirtyDaysCount", "caseClassCoverageArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, last_update_count_date, court, total_case_count, total_cases_in_last_thirty_days_count, total_free_case_document_count, total_free_case_documents_in_last_thirty_days_count, total_paid_case_document_count, total_paid_case_documents_in_last_thirty_days_count, total_case_document_in_library_count, total_case_document_in_library_in_last_thirty_days_count, case_class_coverage_array, *args, **kwargs): # noqa: E501 - """CourtCoverage - a model defined in OpenAPI - - Args: - last_update_count_date (str): Date when it was last updated. - court (Court): - total_case_count (int): Total Cases for a specific court. - total_cases_in_last_thirty_days_count (int): Total Cases in last 30 days that were added to UniCourt - total_free_case_document_count (int): Total Free Case Documents for a specific court. - total_free_case_documents_in_last_thirty_days_count (int): Total Free Case Documents in last 30 days that were added to UniCourt - total_paid_case_document_count (int): Total Paid Case Documents for a specific court. - total_paid_case_documents_in_last_thirty_days_count (int): Total Paid Case Documents in last 30 days that were added to UniCourt - total_case_document_in_library_count (int): Count of total Case Documents added in UniCourt Library. - total_case_document_in_library_in_last_thirty_days_count (int): Count of total Case Documents added in UniCourt Library in last 30 days - case_class_coverage_array ([CaseClassCoverage]): - - Keyword Args: - object (str): Name of the object. defaults to "CourtCoverage" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CourtCoverage") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CourtCoverage from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.last_update_count_date = last_update_count_date - self.court = court - self.total_case_count = total_case_count - self.total_cases_in_last_thirty_days_count = total_cases_in_last_thirty_days_count - self.total_free_case_document_count = total_free_case_document_count - self.total_free_case_documents_in_last_thirty_days_count = total_free_case_documents_in_last_thirty_days_count - self.total_paid_case_document_count = total_paid_case_document_count - self.total_paid_case_documents_in_last_thirty_days_count = total_paid_case_documents_in_last_thirty_days_count - self.total_case_document_in_library_count = total_case_document_in_library_count - self.total_case_document_in_library_in_last_thirty_days_count = total_case_document_in_library_in_last_thirty_days_count - self.case_class_coverage_array = case_class_coverage_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, last_update_count_date, court, total_case_count, total_cases_in_last_thirty_days_count, total_free_case_document_count, total_free_case_documents_in_last_thirty_days_count, total_paid_case_document_count, total_paid_case_documents_in_last_thirty_days_count, total_case_document_in_library_count, total_case_document_in_library_in_last_thirty_days_count, case_class_coverage_array, *args, **kwargs): # noqa: E501 - """CourtCoverage - a model defined in OpenAPI - - Args: - last_update_count_date (str): Date when it was last updated. - court (Court): - total_case_count (int): Total Cases for a specific court. - total_cases_in_last_thirty_days_count (int): Total Cases in last 30 days that were added to UniCourt - total_free_case_document_count (int): Total Free Case Documents for a specific court. - total_free_case_documents_in_last_thirty_days_count (int): Total Free Case Documents in last 30 days that were added to UniCourt - total_paid_case_document_count (int): Total Paid Case Documents for a specific court. - total_paid_case_documents_in_last_thirty_days_count (int): Total Paid Case Documents in last 30 days that were added to UniCourt - total_case_document_in_library_count (int): Count of total Case Documents added in UniCourt Library. - total_case_document_in_library_in_last_thirty_days_count (int): Count of total Case Documents added in UniCourt Library in last 30 days - case_class_coverage_array ([CaseClassCoverage]): - - Keyword Args: - object (str): Name of the object. defaults to "CourtCoverage" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of court + if self.court: + _dict['court'] = self.court.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in case_class_coverage_array (list) + _items = [] + if self.case_class_coverage_array: + for _item in self.case_class_coverage_array: + if _item: + _items.append(_item.to_dict()) + _dict['caseClassCoverageArray'] = _items + return _dict - object = kwargs.get('object', "CourtCoverage") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CourtCoverage from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CourtCoverage', + "lastUpdateCountDate": obj.get("lastUpdateCountDate"), + "court": Court.from_dict(obj["court"]) if obj.get("court") is not None else None, + "totalCaseCount": obj.get("totalCaseCount"), + "totalCasesInLastThirtyDaysCount": obj.get("totalCasesInLastThirtyDaysCount"), + "totalFreeCaseDocumentCount": obj.get("totalFreeCaseDocumentCount"), + "totalFreeCaseDocumentsInLastThirtyDaysCount": obj.get("totalFreeCaseDocumentsInLastThirtyDaysCount"), + "totalPaidCaseDocumentCount": obj.get("totalPaidCaseDocumentCount"), + "totalPaidCaseDocumentsInLastThirtyDaysCount": obj.get("totalPaidCaseDocumentsInLastThirtyDaysCount"), + "totalCaseDocumentInLibraryCount": obj.get("totalCaseDocumentInLibraryCount"), + "totalCaseDocumentInLibraryInLastThirtyDaysCount": obj.get("totalCaseDocumentInLibraryInLastThirtyDaysCount"), + "caseClassCoverageArray": [CaseClassCoverage.from_dict(_item) for _item in obj["caseClassCoverageArray"]] if obj.get("caseClassCoverageArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.last_update_count_date = last_update_count_date - self.court = court - self.total_case_count = total_case_count - self.total_cases_in_last_thirty_days_count = total_cases_in_last_thirty_days_count - self.total_free_case_document_count = total_free_case_document_count - self.total_free_case_documents_in_last_thirty_days_count = total_free_case_documents_in_last_thirty_days_count - self.total_paid_case_document_count = total_paid_case_document_count - self.total_paid_case_documents_in_last_thirty_days_count = total_paid_case_documents_in_last_thirty_days_count - self.total_case_document_in_library_count = total_case_document_in_library_count - self.total_case_document_in_library_in_last_thirty_days_count = total_case_document_in_library_in_last_thirty_days_count - self.case_class_coverage_array = case_class_coverage_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/court_location.py b/unicourt/model/court_location.py index 2cfaf18..c3b6962 100644 --- a/unicourt/model/court_location.py +++ b/unicourt/model/court_location.py @@ -1,365 +1,127 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class CourtLocation(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 13, - 'min_length': 13, - }, - ('court_location_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('street_address1',): { - 'max_length': 250, - 'min_length': 1, - }, - ('street_address2',): { - 'max_length': 150, - }, - ('city',): { - 'max_length': 100, - }, - ('state_name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('courts_for_court_location_api',): { - 'max_length': 255, - 'min_length': 1, - }, - ('court_service_status_api',): { - 'max_length': 2048, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'court_location_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'street_address1': (str, none_type,), # noqa: E501 - 'street_address2': (str, none_type,), # noqa: E501 - 'city': (str, none_type,), # noqa: E501 - 'state_name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - 'courts_for_court_location_api': (str,), # noqa: E501 - 'court_service_status_api': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'court_location_id': 'courtLocationId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'street_address1': 'streetAddress1', # noqa: E501 - 'street_address2': 'streetAddress2', # noqa: E501 - 'city': 'city', # noqa: E501 - 'state_name': 'stateName', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - 'courts_for_court_location_api': 'courtsForCourtLocationAPI', # noqa: E501 - 'court_service_status_api': 'courtServiceStatusAPI', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CourtLocation(BaseModel): + """ + CourtLocation + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=13, strict=True, max_length=13)]] = 'CourtLocation' + court_location_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="courtLocationId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + street_address1: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=250)]] = Field(default=None, description="1st part of the street address.", alias="streetAddress1") + street_address2: Optional[Annotated[str, Field(strict=True, max_length=150)]] = Field(default=None, description="2nd part of the street address.", alias="streetAddress2") + city: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="City") + state_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default='UNKNOWN', description="State Name if present else default value.", alias="stateName") + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + courts_for_court_location_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="courtsForCourtLocationAPI") + court_service_status_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2048)]] = Field(default=None, alias="courtServiceStatusAPI") + __properties: ClassVar[List[str]] = ["object", "courtLocationId", "name", "streetAddress1", "streetAddress2", "city", "stateName", "createdDate", "courtsForCourtLocationAPI", "courtServiceStatusAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, court_location_id, name, street_address1, street_address2, city, created_date, courts_for_court_location_api, court_service_status_api, *args, **kwargs): # noqa: E501 - """CourtLocation - a model defined in OpenAPI - - Args: - court_location_id (str): - name (str): - street_address1 (str, none_type): 1st part of the street address. - street_address2 (str, none_type): 2nd part of the street address. - city (str, none_type): City - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - courts_for_court_location_api (str): - court_service_status_api (str, none_type): - - Keyword Args: - object (str): defaults to "CourtLocation" # noqa: E501 - state_name (str): State Name if present else default value.. defaults to "UNKNOWN" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CourtLocation from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "CourtLocation") - state_name = kwargs.get('state_name', "UNKNOWN") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.court_location_id = court_location_id - self.name = name - self.street_address1 = street_address1 - self.street_address2 = street_address2 - self.city = city - self.state_name = state_name - self.created_date = created_date - self.courts_for_court_location_api = courts_for_court_location_api - self.court_service_status_api = court_service_status_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, court_location_id, name, street_address1, street_address2, city, created_date, courts_for_court_location_api, court_service_status_api, *args, **kwargs): # noqa: E501 - """CourtLocation - a model defined in OpenAPI - - Args: - court_location_id (str): - name (str): - street_address1 (str, none_type): 1st part of the street address. - street_address2 (str, none_type): 2nd part of the street address. - city (str, none_type): City - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - courts_for_court_location_api (str): - court_service_status_api (str, none_type): - - Keyword Args: - object (str): defaults to "CourtLocation" # noqa: E501 - state_name (str): State Name if present else default value.. defaults to "UNKNOWN" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if street_address1 (nullable) is None + # and model_fields_set contains the field + if self.street_address1 is None and "street_address1" in self.model_fields_set: + _dict['streetAddress1'] = None + + # set to None if street_address2 (nullable) is None + # and model_fields_set contains the field + if self.street_address2 is None and "street_address2" in self.model_fields_set: + _dict['streetAddress2'] = None + + # set to None if city (nullable) is None + # and model_fields_set contains the field + if self.city is None and "city" in self.model_fields_set: + _dict['city'] = None + + # set to None if court_service_status_api (nullable) is None + # and model_fields_set contains the field + if self.court_service_status_api is None and "court_service_status_api" in self.model_fields_set: + _dict['courtServiceStatusAPI'] = None + + return _dict - object = kwargs.get('object', "CourtLocation") - state_name = kwargs.get('state_name', "UNKNOWN") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CourtLocation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CourtLocation', + "courtLocationId": obj.get("courtLocationId"), + "name": obj.get("name"), + "streetAddress1": obj.get("streetAddress1"), + "streetAddress2": obj.get("streetAddress2"), + "city": obj.get("city"), + "stateName": obj.get("stateName") if obj.get("stateName") is not None else 'UNKNOWN', + "createdDate": obj.get("createdDate"), + "courtsForCourtLocationAPI": obj.get("courtsForCourtLocationAPI"), + "courtServiceStatusAPI": obj.get("courtServiceStatusAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.court_location_id = court_location_id - self.name = name - self.street_address1 = street_address1 - self.street_address2 = street_address2 - self.city = city - self.state_name = state_name - self.created_date = created_date - self.courts_for_court_location_api = courts_for_court_location_api - self.court_service_status_api = court_service_status_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/court_location_response.py b/unicourt/model/court_location_response.py index 5119313..ec86c52 100644 --- a/unicourt/model/court_location_response.py +++ b/unicourt/model/court_location_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.court_location import CourtLocation - globals()['CourtLocation'] = CourtLocation - - -class CourtLocationResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 21, - 'min_length': 21, - }, - ('court_location_array',): { - }, - ('next_page_api',): { - 'max_length': 2144, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2143, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'court_location_array': ([CourtLocation],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'court_location_array': 'courtLocationArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.court_location import CourtLocation +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CourtLocationResponse(BaseModel): + """ + CourtLocationResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=21, strict=True, max_length=21)]] = 'CourtLocationResponse' + court_location_array: Optional[List[CourtLocation]] = Field(default=None, alias="courtLocationArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2144)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2143)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "courtLocationArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, court_location_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CourtLocationResponse - a model defined in OpenAPI - - Args: - court_location_array ([CourtLocation]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CourtLocationResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CourtLocationResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CourtLocationResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.court_location_array = court_location_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, court_location_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CourtLocationResponse - a model defined in OpenAPI - - Args: - court_location_array ([CourtLocation]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CourtLocationResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in court_location_array (list) + _items = [] + if self.court_location_array: + for _item in self.court_location_array: + if _item: + _items.append(_item.to_dict()) + _dict['courtLocationArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CourtLocationResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CourtLocationResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CourtLocationResponse', + "courtLocationArray": [CourtLocation.from_dict(_item) for _item in obj["courtLocationArray"]] if obj.get("courtLocationArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.court_location_array = court_location_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/court_response.py b/unicourt/model/court_response.py index a9cf246..ef5aabc 100644 --- a/unicourt/model/court_response.py +++ b/unicourt/model/court_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.court import Court - globals()['Court'] = Court - - -class CourtResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 13, - 'min_length': 13, - }, - ('court_array',): { - }, - ('next_page_api',): { - 'max_length': 2136, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2135, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'court_array': ([Court],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'court_array': 'courtArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.court import Court +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CourtResponse(BaseModel): + """ + CourtResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=13, strict=True, max_length=13)]] = 'CourtResponse' + court_array: Optional[List[Court]] = Field(default=None, alias="courtArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2136)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2135)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total pages for matches that were found in the index.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="The number of matches that were found in the index.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "courtArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, court_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CourtResponse - a model defined in OpenAPI - - Args: - court_array ([Court]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): - total_pages (int): Total pages for matches that were found in the index. - total_count (int): The number of matches that were found in the index. - - Keyword Args: - object (str): defaults to "CourtResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CourtResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CourtResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.court_array = court_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, court_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CourtResponse - a model defined in OpenAPI - - Args: - court_array ([Court]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): - total_pages (int): Total pages for matches that were found in the index. - total_count (int): The number of matches that were found in the index. - - Keyword Args: - object (str): defaults to "CourtResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in court_array (list) + _items = [] + if self.court_array: + for _item in self.court_array: + if _item: + _items.append(_item.to_dict()) + _dict['courtArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CourtResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CourtResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CourtResponse', + "courtArray": [Court.from_dict(_item) for _item in obj["courtArray"]] if obj.get("courtArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.court_array = court_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/court_service_status.py b/unicourt/model/court_service_status.py index d68e9b2..92dc7a8 100644 --- a/unicourt/model/court_service_status.py +++ b/unicourt/model/court_service_status.py @@ -1,337 +1,119 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.service_status import ServiceStatus - globals()['ServiceStatus'] = ServiceStatus - - -class CourtServiceStatus(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 18, - 'min_length': 18, - }, - ('court_service_status_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('service_status_as_on',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'court_service_status_id': (str,), # noqa: E501 - 'court_id_array': ([str, none_type], none_type,), # noqa: E501 - 'court_location_id_array': ([str, none_type], none_type,), # noqa: E501 - 'case_class_id_array': ([str, none_type], none_type,), # noqa: E501 - 'service_status_as_on': (str, none_type,), # noqa: E501 - 'case_update_service_status': (ServiceStatus,), # noqa: E501 - 'case_track_service_status': (ServiceStatus,), # noqa: E501 - 'case_document_order_service_status': (ServiceStatus,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'court_service_status_id': 'courtServiceStatusId', # noqa: E501 - 'court_id_array': 'courtIdArray', # noqa: E501 - 'court_location_id_array': 'courtLocationIdArray', # noqa: E501 - 'case_class_id_array': 'caseClassIdArray', # noqa: E501 - 'service_status_as_on': 'serviceStatusAsOn', # noqa: E501 - 'case_update_service_status': 'caseUpdateServiceStatus', # noqa: E501 - 'case_track_service_status': 'caseTrackServiceStatus', # noqa: E501 - 'case_document_order_service_status': 'caseDocumentOrderServiceStatus', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.service_status import ServiceStatus +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CourtServiceStatus(BaseModel): + """ + CourtServiceStatus + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default='CourtServiceStatus', description="Name of the object") + court_service_status_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Court Service Status Object ID", alias="courtServiceStatusId") + court_id_array: Optional[List[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]]]] = Field(default=None, description="All the court ids associated to the service status", alias="courtIdArray") + court_location_id_array: Optional[List[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]]]] = Field(default=None, description="All the court location ids associated to the service status", alias="courtLocationIdArray") + case_class_id_array: Optional[List[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]]]] = Field(default=None, description="All the Case class ids associated to the service status", alias="caseClassIdArray") + service_status_as_on: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="Date when the service status was last fetched.", alias="serviceStatusAsOn") + case_update_service_status: Optional[ServiceStatus] = Field(default=None, alias="caseUpdateServiceStatus") + case_track_service_status: Optional[ServiceStatus] = Field(default=None, alias="caseTrackServiceStatus") + case_document_order_service_status: Optional[ServiceStatus] = Field(default=None, alias="caseDocumentOrderServiceStatus") + __properties: ClassVar[List[str]] = ["object", "courtServiceStatusId", "courtIdArray", "courtLocationIdArray", "caseClassIdArray", "serviceStatusAsOn", "caseUpdateServiceStatus", "caseTrackServiceStatus", "caseDocumentOrderServiceStatus"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, court_service_status_id, court_id_array, court_location_id_array, case_class_id_array, service_status_as_on, case_update_service_status, case_track_service_status, case_document_order_service_status, *args, **kwargs): # noqa: E501 - """CourtServiceStatus - a model defined in OpenAPI - - Args: - court_service_status_id (str): Court Service Status Object ID - court_id_array ([str, none_type], none_type): All the court ids associated to the service status - court_location_id_array ([str, none_type], none_type): All the court location ids associated to the service status - case_class_id_array ([str, none_type], none_type): All the Case class ids associated to the service status - service_status_as_on (str, none_type): Date when the service status was last fetched. - case_update_service_status (ServiceStatus): - case_track_service_status (ServiceStatus): - case_document_order_service_status (ServiceStatus): - - Keyword Args: - object (str): Name of the object. defaults to "CourtServiceStatus" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CourtServiceStatus") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CourtServiceStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.court_service_status_id = court_service_status_id - self.court_id_array = court_id_array - self.court_location_id_array = court_location_id_array - self.case_class_id_array = case_class_id_array - self.service_status_as_on = service_status_as_on - self.case_update_service_status = case_update_service_status - self.case_track_service_status = case_track_service_status - self.case_document_order_service_status = case_document_order_service_status - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, court_service_status_id, court_id_array, court_location_id_array, case_class_id_array, service_status_as_on, case_update_service_status, case_track_service_status, case_document_order_service_status, *args, **kwargs): # noqa: E501 - """CourtServiceStatus - a model defined in OpenAPI - - Args: - court_service_status_id (str): Court Service Status Object ID - court_id_array ([str, none_type], none_type): All the court ids associated to the service status - court_location_id_array ([str, none_type], none_type): All the court location ids associated to the service status - case_class_id_array ([str, none_type], none_type): All the Case class ids associated to the service status - service_status_as_on (str, none_type): Date when the service status was last fetched. - case_update_service_status (ServiceStatus): - case_track_service_status (ServiceStatus): - case_document_order_service_status (ServiceStatus): - - Keyword Args: - object (str): Name of the object. defaults to "CourtServiceStatus" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_update_service_status + if self.case_update_service_status: + _dict['caseUpdateServiceStatus'] = self.case_update_service_status.to_dict() + # override the default output from pydantic by calling `to_dict()` of case_track_service_status + if self.case_track_service_status: + _dict['caseTrackServiceStatus'] = self.case_track_service_status.to_dict() + # override the default output from pydantic by calling `to_dict()` of case_document_order_service_status + if self.case_document_order_service_status: + _dict['caseDocumentOrderServiceStatus'] = self.case_document_order_service_status.to_dict() + # set to None if service_status_as_on (nullable) is None + # and model_fields_set contains the field + if self.service_status_as_on is None and "service_status_as_on" in self.model_fields_set: + _dict['serviceStatusAsOn'] = None + + return _dict - object = kwargs.get('object', "CourtServiceStatus") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CourtServiceStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CourtServiceStatus', + "courtServiceStatusId": obj.get("courtServiceStatusId"), + "courtIdArray": obj.get("courtIdArray"), + "courtLocationIdArray": obj.get("courtLocationIdArray"), + "caseClassIdArray": obj.get("caseClassIdArray"), + "serviceStatusAsOn": obj.get("serviceStatusAsOn"), + "caseUpdateServiceStatus": ServiceStatus.from_dict(obj["caseUpdateServiceStatus"]) if obj.get("caseUpdateServiceStatus") is not None else None, + "caseTrackServiceStatus": ServiceStatus.from_dict(obj["caseTrackServiceStatus"]) if obj.get("caseTrackServiceStatus") is not None else None, + "caseDocumentOrderServiceStatus": ServiceStatus.from_dict(obj["caseDocumentOrderServiceStatus"]) if obj.get("caseDocumentOrderServiceStatus") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.court_service_status_id = court_service_status_id - self.court_id_array = court_id_array - self.court_location_id_array = court_location_id_array - self.case_class_id_array = case_class_id_array - self.service_status_as_on = service_status_as_on - self.case_update_service_status = case_update_service_status - self.case_track_service_status = case_track_service_status - self.case_document_order_service_status = case_document_order_service_status - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/court_service_status_response.py b/unicourt/model/court_service_status_response.py index 7cb3581..9145690 100644 --- a/unicourt/model/court_service_status_response.py +++ b/unicourt/model/court_service_status_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.court_service_status import CourtServiceStatus - globals()['CourtServiceStatus'] = CourtServiceStatus - - -class CourtServiceStatusResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 26, - 'min_length': 26, - }, - ('court_service_status_array',): { - }, - ('next_page_api',): { - 'max_length': 2153, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2152, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'court_service_status_array': ([CourtServiceStatus],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'court_service_status_array': 'courtServiceStatusArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.court_service_status import CourtServiceStatus +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CourtServiceStatusResponse(BaseModel): + """ + CourtServiceStatusResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=26, strict=True, max_length=26)]] = 'CourtServiceStatusResponse' + court_service_status_array: Optional[List[CourtServiceStatus]] = Field(default=None, alias="courtServiceStatusArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2153)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2152)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "courtServiceStatusArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, court_service_status_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CourtServiceStatusResponse - a model defined in OpenAPI - - Args: - court_service_status_array ([CourtServiceStatus]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CourtServiceStatusResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CourtServiceStatusResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CourtServiceStatusResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.court_service_status_array = court_service_status_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, court_service_status_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CourtServiceStatusResponse - a model defined in OpenAPI - - Args: - court_service_status_array ([CourtServiceStatus]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CourtServiceStatusResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in court_service_status_array (list) + _items = [] + if self.court_service_status_array: + for _item in self.court_service_status_array: + if _item: + _items.append(_item.to_dict()) + _dict['courtServiceStatusArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CourtServiceStatusResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CourtServiceStatusResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CourtServiceStatusResponse', + "courtServiceStatusArray": [CourtServiceStatus.from_dict(_item) for _item in obj["courtServiceStatusArray"]] if obj.get("courtServiceStatusArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.court_service_status_array = court_service_status_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/court_system.py b/unicourt/model/court_system.py index 9c546fb..35d9f71 100644 --- a/unicourt/model/court_system.py +++ b/unicourt/model/court_system.py @@ -1,325 +1,99 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CourtSystem(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CourtSystem(BaseModel): """ + CourtSystem + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=11, strict=True, max_length=11)]] = 'CourtSystem' + court_type_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="courtTypeId") + court_system_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="courtSystemId") + court_type: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="courtType") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when the Court was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "courtTypeId", "courtSystemId", "courtType", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 11, - 'min_length': 11, - }, - ('court_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('court_system_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('court_type',): { - 'max_length': 255, - 'min_length': 1, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CourtSystem from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'court_type_id': (str,), # noqa: E501 - 'court_system_id': (str,), # noqa: E501 - 'court_type': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'court_type_id': 'courtTypeId', # noqa: E501 - 'court_system_id': 'courtSystemId', # noqa: E501 - 'court_type': 'courtType', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, court_type_id, court_system_id, court_type, name, created_date, *args, **kwargs): # noqa: E501 - """CourtSystem - a model defined in OpenAPI - - Args: - court_type_id (str): - court_system_id (str): - court_type (str): - name (str): - created_date (datetime): The date and time when the Court was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CourtSystem" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CourtSystem") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.court_type_id = court_type_id - self.court_system_id = court_system_id - self.court_type = court_type - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, court_type_id, court_system_id, court_type, name, created_date, *args, **kwargs): # noqa: E501 - """CourtSystem - a model defined in OpenAPI - - Args: - court_type_id (str): - court_system_id (str): - court_type (str): - name (str): - created_date (datetime): The date and time when the Court was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CourtSystem" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CourtSystem from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CourtSystem") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CourtSystem', + "courtTypeId": obj.get("courtTypeId"), + "courtSystemId": obj.get("courtSystemId"), + "courtType": obj.get("courtType"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.court_type_id = court_type_id - self.court_system_id = court_system_id - self.court_type = court_type - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/court_system_response.py b/unicourt/model/court_system_response.py index aafe25b..58f66b0 100644 --- a/unicourt/model/court_system_response.py +++ b/unicourt/model/court_system_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.court_system import CourtSystem - globals()['CourtSystem'] = CourtSystem - - -class CourtSystemResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 19, - 'min_length': 19, - }, - ('court_system_array',): { - }, - ('next_page_api',): { - 'max_length': 2142, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2141, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'court_system_array': ([CourtSystem],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'court_system_array': 'courtSystemArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.court_system import CourtSystem +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CourtSystemResponse(BaseModel): + """ + CourtSystemResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=19, strict=True, max_length=19)]] = 'CourtSystemResponse' + court_system_array: Optional[List[CourtSystem]] = Field(default=None, alias="courtSystemArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2142)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2141)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "courtSystemArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, court_system_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CourtSystemResponse - a model defined in OpenAPI - - Args: - court_system_array ([CourtSystem]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CourtSystemResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CourtSystemResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CourtSystemResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.court_system_array = court_system_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, court_system_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CourtSystemResponse - a model defined in OpenAPI - - Args: - court_system_array ([CourtSystem]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CourtSystemResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in court_system_array (list) + _items = [] + if self.court_system_array: + for _item in self.court_system_array: + if _item: + _items.append(_item.to_dict()) + _dict['courtSystemArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CourtSystemResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CourtSystemResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CourtSystemResponse', + "courtSystemArray": [CourtSystem.from_dict(_item) for _item in obj["courtSystemArray"]] if obj.get("courtSystemArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.court_system_array = court_system_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/court_type.py b/unicourt/model/court_type.py index 3a4beca..2dfa4f2 100644 --- a/unicourt/model/court_type.py +++ b/unicourt/model/court_type.py @@ -1,305 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class CourtType(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class CourtType(BaseModel): """ + CourtType + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]] = 'CourtType' + court_type_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="courtTypeId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when the Court was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "courtTypeId", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 9, - 'min_length': 9, - }, - ('court_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CourtType from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'court_type_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'court_type_id': 'courtTypeId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, court_type_id, name, created_date, *args, **kwargs): # noqa: E501 - """CourtType - a model defined in OpenAPI - - Args: - court_type_id (str): - name (str): - created_date (datetime): The date and time when the Court was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CourtType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CourtType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.court_type_id = court_type_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, court_type_id, name, created_date, *args, **kwargs): # noqa: E501 - """CourtType - a model defined in OpenAPI - - Args: - court_type_id (str): - name (str): - created_date (datetime): The date and time when the Court was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "CourtType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CourtType from a dict""" + if obj is None: + return None - object = kwargs.get('object', "CourtType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CourtType', + "courtTypeId": obj.get("courtTypeId"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.court_type_id = court_type_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/court_type_response.py b/unicourt/model/court_type_response.py index 4a9ae8a..79a3e0a 100644 --- a/unicourt/model/court_type_response.py +++ b/unicourt/model/court_type_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.court_type import CourtType - globals()['CourtType'] = CourtType - - -class CourtTypeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 17, - 'min_length': 17, - }, - ('court_type_array',): { - }, - ('next_page_api',): { - 'max_length': 2140, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2139, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'court_type_array': ([CourtType],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'court_type_array': 'courtTypeArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.court_type import CourtType +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class CourtTypeResponse(BaseModel): + """ + CourtTypeResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=17)]] = 'CourtTypeResponse' + court_type_array: Optional[List[CourtType]] = Field(default=None, alias="courtTypeArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2140)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2139)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "courtTypeArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, court_type_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CourtTypeResponse - a model defined in OpenAPI - - Args: - court_type_array ([CourtType]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CourtTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "CourtTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CourtTypeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.court_type_array = court_type_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, court_type_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """CourtTypeResponse - a model defined in OpenAPI - - Args: - court_type_array ([CourtType]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "CourtTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in court_type_array (list) + _items = [] + if self.court_type_array: + for _item in self.court_type_array: + if _item: + _items.append(_item.to_dict()) + _dict['courtTypeArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "CourtTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CourtTypeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'CourtTypeResponse', + "courtTypeArray": [CourtType.from_dict(_item) for _item in obj["courtTypeArray"]] if obj.get("courtTypeArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.court_type_array = court_type_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/daily_usage_response.py b/unicourt/model/daily_usage_response.py index 8c469c7..d05a02f 100644 --- a/unicourt/model/daily_usage_response.py +++ b/unicourt/model/daily_usage_response.py @@ -1,329 +1,113 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.billing_cycle_usage_response_api_calls_billable import BillingCycleUsageResponseApiCallsBillable - from unicourt.model.billing_cycle_usage_response_api_calls_credited import BillingCycleUsageResponseApiCallsCredited - from unicourt.model.billing_cycle_usage_response_api_calls_made import BillingCycleUsageResponseApiCallsMade - globals()['BillingCycleUsageResponseApiCallsBillable'] = BillingCycleUsageResponseApiCallsBillable - globals()['BillingCycleUsageResponseApiCallsCredited'] = BillingCycleUsageResponseApiCallsCredited - globals()['BillingCycleUsageResponseApiCallsMade'] = BillingCycleUsageResponseApiCallsMade - - -class DailyUsageResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 18, - 'min_length': 18, - }, - ('usage_start_time',): { - 'max_length': 25, - 'min_length': 25, - }, - ('usage_end_time',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'usage_start_time': (datetime,), # noqa: E501 - 'usage_end_time': (datetime,), # noqa: E501 - 'api_usage': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'api_calls_made': (BillingCycleUsageResponseApiCallsMade,), # noqa: E501 - 'api_calls_credited': (BillingCycleUsageResponseApiCallsCredited,), # noqa: E501 - 'api_calls_billable': (BillingCycleUsageResponseApiCallsBillable,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'usage_start_time': 'usageStartTime', # noqa: E501 - 'usage_end_time': 'usageEndTime', # noqa: E501 - 'api_usage': 'apiUsage', # noqa: E501 - 'api_calls_made': 'apiCallsMade', # noqa: E501 - 'api_calls_credited': 'apiCallsCredited', # noqa: E501 - 'api_calls_billable': 'apiCallsBillable', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.billing_cycle_usage_response_api_calls_billable import BillingCycleUsageResponseApiCallsBillable +from unicourt.model.billing_cycle_usage_response_api_calls_credited import BillingCycleUsageResponseApiCallsCredited +from unicourt.model.billing_cycle_usage_response_api_calls_made import BillingCycleUsageResponseApiCallsMade +from typing import Optional, Set +from typing_extensions import Self + +class DailyUsageResponse(BaseModel): + """ + DailyUsageResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default='DailyUsageResponse', description="Name of the object.") + usage_start_time: Optional[datetime] = Field(default=None, description="Start time of the usage.", alias="usageStartTime") + usage_end_time: Optional[datetime] = Field(default=None, description="End time of the usage.", alias="usageEndTime") + api_usage: Optional[Dict[str, Any]] = Field(default=None, description="Api Usage made in real time.", alias="apiUsage") + api_calls_made: Optional[BillingCycleUsageResponseApiCallsMade] = Field(default=None, alias="apiCallsMade") + api_calls_credited: Optional[BillingCycleUsageResponseApiCallsCredited] = Field(default=None, alias="apiCallsCredited") + api_calls_billable: Optional[BillingCycleUsageResponseApiCallsBillable] = Field(default=None, alias="apiCallsBillable") + __properties: ClassVar[List[str]] = ["object", "usageStartTime", "usageEndTime", "apiUsage", "apiCallsMade", "apiCallsCredited", "apiCallsBillable"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, usage_start_time, usage_end_time, api_usage, api_calls_made, api_calls_credited, api_calls_billable, *args, **kwargs): # noqa: E501 - """DailyUsageResponse - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DailyUsageResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - usage_start_time (datetime): Start time of the usage. - usage_end_time (datetime): End time of the usage. - api_usage ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Api Usage made in real time. - api_calls_made (BillingCycleUsageResponseApiCallsMade): - api_calls_credited (BillingCycleUsageResponseApiCallsCredited): - api_calls_billable (BillingCycleUsageResponseApiCallsBillable): - - Keyword Args: - object (str): Name of the object.. defaults to "DailyUsageResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "DailyUsageResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.usage_start_time = usage_start_time - self.usage_end_time = usage_end_time - self.api_usage = api_usage - self.api_calls_made = api_calls_made - self.api_calls_credited = api_calls_credited - self.api_calls_billable = api_calls_billable - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, usage_start_time, usage_end_time, api_usage, api_calls_made, api_calls_credited, api_calls_billable, *args, **kwargs): # noqa: E501 - """DailyUsageResponse - a model defined in OpenAPI - - Args: - usage_start_time (datetime): Start time of the usage. - usage_end_time (datetime): End time of the usage. - api_usage ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Api Usage made in real time. - api_calls_made (BillingCycleUsageResponseApiCallsMade): - api_calls_credited (BillingCycleUsageResponseApiCallsCredited): - api_calls_billable (BillingCycleUsageResponseApiCallsBillable): - - Keyword Args: - object (str): Name of the object.. defaults to "DailyUsageResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of api_calls_made + if self.api_calls_made: + _dict['apiCallsMade'] = self.api_calls_made.to_dict() + # override the default output from pydantic by calling `to_dict()` of api_calls_credited + if self.api_calls_credited: + _dict['apiCallsCredited'] = self.api_calls_credited.to_dict() + # override the default output from pydantic by calling `to_dict()` of api_calls_billable + if self.api_calls_billable: + _dict['apiCallsBillable'] = self.api_calls_billable.to_dict() + return _dict - object = kwargs.get('object', "DailyUsageResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DailyUsageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'DailyUsageResponse', + "usageStartTime": obj.get("usageStartTime"), + "usageEndTime": obj.get("usageEndTime"), + "apiUsage": obj.get("apiUsage"), + "apiCallsMade": BillingCycleUsageResponseApiCallsMade.from_dict(obj["apiCallsMade"]) if obj.get("apiCallsMade") is not None else None, + "apiCallsCredited": BillingCycleUsageResponseApiCallsCredited.from_dict(obj["apiCallsCredited"]) if obj.get("apiCallsCredited") is not None else None, + "apiCallsBillable": BillingCycleUsageResponseApiCallsBillable.from_dict(obj["apiCallsBillable"]) if obj.get("apiCallsBillable") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.usage_start_time = usage_start_time - self.usage_end_time = usage_end_time - self.api_usage = api_usage - self.api_calls_made = api_calls_made - self.api_calls_credited = api_calls_credited - self.api_calls_billable = api_calls_billable - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/docket_entries.py b/unicourt/model/docket_entries.py index 89f6eda..8b30318 100644 --- a/unicourt/model/docket_entries.py +++ b/unicourt/model/docket_entries.py @@ -1,317 +1,111 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.docket_entry import DocketEntry - globals()['DocketEntry'] = DocketEntry +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class DocketEntries(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.docket_entry import DocketEntry +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class DocketEntries(BaseModel): """ + DocketEntries + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=13, strict=True, max_length=13)]] = Field(default='DocketEntries', description="Name of the object") + page_number: Optional[StrictInt] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + docket_entry_array: Optional[Annotated[List[DocketEntry], Field(max_length=100)]] = Field(default=None, alias="docketEntryArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to next page of a particular entity in a Case.", alias="nextPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects of a party in the Case.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of parties of the Case entity in a Case.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "pageNumber", "docketEntryArray", "nextPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 13, - 'min_length': 13, - }, - ('docket_entry_array',): { - 'max_items': 100, - }, - ('next_page_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocketEntries from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'docket_entry_array': ([DocketEntry],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'docket_entry_array': 'docketEntryArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in docket_entry_array (list) + _items = [] + if self.docket_entry_array: + for _item in self.docket_entry_array: + if _item: + _items.append(_item.to_dict()) + _dict['docketEntryArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, page_number, docket_entry_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """DocketEntries - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - docket_entry_array ([DocketEntry]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "DocketEntries" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "DocketEntries") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.page_number = page_number - self.docket_entry_array = docket_entry_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, page_number, docket_entry_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """DocketEntries - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - docket_entry_array ([DocketEntry]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "DocketEntries" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocketEntries from a dict""" + if obj is None: + return None - object = kwargs.get('object', "DocketEntries") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'DocketEntries', + "pageNumber": obj.get("pageNumber"), + "docketEntryArray": [DocketEntry.from_dict(_item) for _item in obj["docketEntryArray"]] if obj.get("docketEntryArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.page_number = page_number - self.docket_entry_array = docket_entry_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/docket_entry.py b/unicourt/model/docket_entry.py index 369061d..9feaf04 100644 --- a/unicourt/model/docket_entry.py +++ b/unicourt/model/docket_entry.py @@ -1,388 +1,161 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.docket_entry_primary_documents import DocketEntryPrimaryDocuments - from unicourt.model.docket_entry_secondary_documents import DocketEntrySecondaryDocuments - from unicourt.model.referenced_docket_number import ReferencedDocketNumber - from unicourt.model.source_structured_data import SourceStructuredData - globals()['DocketEntryPrimaryDocuments'] = DocketEntryPrimaryDocuments - globals()['DocketEntrySecondaryDocuments'] = DocketEntrySecondaryDocuments - globals()['ReferencedDocketNumber'] = ReferencedDocketNumber - globals()['SourceStructuredData'] = SourceStructuredData - - -class DocketEntry(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('docket_badge',): { - 'DOCKET': "DOCKET", - 'CHARGE': "CHARGE", - 'HEARING': "HEARING", - 'JUDGEMENT': "JUDGEMENT", - 'FINANCIAL': "FINANCIAL", - 'DISPOSITION': "DISPOSITION", - 'SENTENCE': "SENTENCE", - 'BOND': "BOND", - 'BAIL': "BAIL", - 'CAUSE_OF_ACTION': "CAUSE_OF_ACTION", - 'ARREST': "ARREST", - 'WARRANT': "WARRANT", - 'SUMMON': "SUMMON", - 'TICKLER': "TICKLER", - 'OPINION': "OPINION", - }, - ('boundary',): { - 'None': None, - 'FIRST': "first", - 'LAST': "last", - 'SINGLE_DOCKET_ENTRY': "single_docket_entry", - 'NULL': "null", - }, - } - - validations = { - ('object',): { - 'max_length': 11, - 'min_length': 11, - }, - ('docket_entry_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('text',): { - 'max_length': 1000000, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'sort_order': (int,), # noqa: E501 - 'docket_entry_date': (datetime,), # noqa: E501 - 'docket_number': (int, none_type,), # noqa: E501 - 'docket_badge': (str,), # noqa: E501 - 'text': (str,), # noqa: E501 - 'text_structured': (SourceStructuredData,), # noqa: E501 - 'referenced_docket_number_array': ([ReferencedDocketNumber],), # noqa: E501 - 'docket_entry_primary_documents': (DocketEntryPrimaryDocuments,), # noqa: E501 - 'docket_entry_secondary_documents': (DocketEntrySecondaryDocuments,), # noqa: E501 - 'last_fetch_date': (str,), # noqa: E501 - 'boundary': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'sort_order': 'sortOrder', # noqa: E501 - 'docket_entry_date': 'docketEntryDate', # noqa: E501 - 'docket_number': 'docketNumber', # noqa: E501 - 'docket_badge': 'docketBadge', # noqa: E501 - 'text': 'text', # noqa: E501 - 'text_structured': 'textStructured', # noqa: E501 - 'referenced_docket_number_array': 'referencedDocketNumberArray', # noqa: E501 - 'docket_entry_primary_documents': 'docketEntryPrimaryDocuments', # noqa: E501 - 'docket_entry_secondary_documents': 'docketEntrySecondaryDocuments', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'boundary': 'boundary', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.docket_entry_primary_documents import DocketEntryPrimaryDocuments +from unicourt.model.docket_entry_secondary_documents import DocketEntrySecondaryDocuments +from unicourt.model.referenced_docket_number import ReferencedDocketNumber +from unicourt.model.source_structured_data import SourceStructuredData +from typing import Optional, Set +from typing_extensions import Self + +class DocketEntry(BaseModel): + """ + DocketEntry + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=11, strict=True, max_length=11)]] = Field(default='DocketEntry', description="Name of the object") + sort_order: Optional[StrictInt] = Field(default=None, description="Order number how the dockets have stored in UniCourt.", alias="sortOrder") + docket_entry_date: Optional[datetime] = Field(default=None, description="Docket Action Date", alias="docketEntryDate") + docket_number: Optional[StrictInt] = Field(default=None, description="The respective docket entry number which is defined in the court website.", alias="docketNumber") + docket_badge: Optional[StrictStr] = Field(default=None, description="Docket Badge helps you to know what type of a docket entry it is.", alias="docketBadge") + text: Optional[StrictStr] = Field(default=None, description="Source Docket Entry") + text_structured: Optional[SourceStructuredData] = Field(default=None, alias="textStructured") + referenced_docket_number_array: Optional[List[ReferencedDocketNumber]] = Field(default=None, description="Other Docket Numbers that referenced for a particular docket entry.", alias="referencedDocketNumberArray") + docket_entry_primary_documents: Optional[DocketEntryPrimaryDocuments] = Field(default=None, alias="docketEntryPrimaryDocuments") + docket_entry_secondary_documents: Optional[DocketEntrySecondaryDocuments] = Field(default=None, alias="docketEntrySecondaryDocuments") + last_fetch_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="When this docket entry was last fetched from the source.", alias="lastFetchDate") + boundary: Optional[StrictStr] = Field(default=None, description="Determines if it is the first docket entry or the last docket entry. This value will be set only for the first and last docket entry. For other docket entries it will be null. However, this will be set as single_docket_entry when the Case contains only one docket entry.") + __properties: ClassVar[List[str]] = ["object", "sortOrder", "docketEntryDate", "docketNumber", "docketBadge", "text", "textStructured", "referencedDocketNumberArray", "docketEntryPrimaryDocuments", "docketEntrySecondaryDocuments", "lastFetchDate", "boundary"] + + @field_validator('docket_badge') + def docket_badge_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['DOCKET', 'CHARGE', 'HEARING', 'JUDGEMENT', 'FINANCIAL', 'DISPOSITION', 'SENTENCE', 'BOND', 'BAIL', 'CAUSE_OF_ACTION', 'ARREST', 'WARRANT', 'SUMMON', 'TICKLER', 'OPINION']): + raise ValueError("must be one of enum values ('DOCKET', 'CHARGE', 'HEARING', 'JUDGEMENT', 'FINANCIAL', 'DISPOSITION', 'SENTENCE', 'BOND', 'BAIL', 'CAUSE_OF_ACTION', 'ARREST', 'WARRANT', 'SUMMON', 'TICKLER', 'OPINION')") + return value + + @field_validator('boundary') + def boundary_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['first', 'last', 'single_docket_entry', 'null']): + raise ValueError("must be one of enum values ('first', 'last', 'single_docket_entry', 'null')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, sort_order, docket_entry_date, docket_number, docket_badge, text, text_structured, referenced_docket_number_array, docket_entry_primary_documents, docket_entry_secondary_documents, last_fetch_date, boundary, *args, **kwargs): # noqa: E501 - """DocketEntry - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocketEntry from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - sort_order (int): Order number how the dockets have stored in UniCourt. - docket_entry_date (datetime): Docket Action Date - docket_number (int, none_type): The respective docket entry number which is defined in the court website. - docket_badge (str): Docket Badge helps you to know what type of a docket entry it is. - text (str): Source Docket Entry - text_structured (SourceStructuredData): - referenced_docket_number_array ([ReferencedDocketNumber]): Other Docket Numbers that referenced for a particular docket entry. - docket_entry_primary_documents (DocketEntryPrimaryDocuments): - docket_entry_secondary_documents (DocketEntrySecondaryDocuments): - last_fetch_date (str): When this docket entry was last fetched from the source. - boundary (str, none_type): Determines if it is the first docket entry or the last docket entry. This value will be set only for the first and last docket entry. For other docket entries it will be null. However, this will be set as single_docket_entry when the Case contains only one docket entry. - - Keyword Args: - object (str): Name of the object. defaults to "DocketEntry" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "DocketEntry") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.sort_order = sort_order - self.docket_entry_date = docket_entry_date - self.docket_number = docket_number - self.docket_badge = docket_badge - self.text = text - self.text_structured = text_structured - self.referenced_docket_number_array = referenced_docket_number_array - self.docket_entry_primary_documents = docket_entry_primary_documents - self.docket_entry_secondary_documents = docket_entry_secondary_documents - self.last_fetch_date = last_fetch_date - self.boundary = boundary - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, sort_order, docket_entry_date, docket_number, docket_badge, text, text_structured, referenced_docket_number_array, docket_entry_primary_documents, docket_entry_secondary_documents, last_fetch_date, boundary, *args, **kwargs): # noqa: E501 - """DocketEntry - a model defined in OpenAPI - - Args: - sort_order (int): Order number how the dockets have stored in UniCourt. - docket_entry_date (datetime): Docket Action Date - docket_number (int, none_type): The respective docket entry number which is defined in the court website. - docket_badge (str): Docket Badge helps you to know what type of a docket entry it is. - text (str): Source Docket Entry - text_structured (SourceStructuredData): - referenced_docket_number_array ([ReferencedDocketNumber]): Other Docket Numbers that referenced for a particular docket entry. - docket_entry_primary_documents (DocketEntryPrimaryDocuments): - docket_entry_secondary_documents (DocketEntrySecondaryDocuments): - last_fetch_date (str): When this docket entry was last fetched from the source. - boundary (str, none_type): Determines if it is the first docket entry or the last docket entry. This value will be set only for the first and last docket entry. For other docket entries it will be null. However, this will be set as single_docket_entry when the Case contains only one docket entry. - - Keyword Args: - object (str): Name of the object. defaults to "DocketEntry" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of text_structured + if self.text_structured: + _dict['textStructured'] = self.text_structured.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in referenced_docket_number_array (list) + _items = [] + if self.referenced_docket_number_array: + for _item in self.referenced_docket_number_array: + if _item: + _items.append(_item.to_dict()) + _dict['referencedDocketNumberArray'] = _items + # override the default output from pydantic by calling `to_dict()` of docket_entry_primary_documents + if self.docket_entry_primary_documents: + _dict['docketEntryPrimaryDocuments'] = self.docket_entry_primary_documents.to_dict() + # override the default output from pydantic by calling `to_dict()` of docket_entry_secondary_documents + if self.docket_entry_secondary_documents: + _dict['docketEntrySecondaryDocuments'] = self.docket_entry_secondary_documents.to_dict() + # set to None if docket_number (nullable) is None + # and model_fields_set contains the field + if self.docket_number is None and "docket_number" in self.model_fields_set: + _dict['docketNumber'] = None + + # set to None if boundary (nullable) is None + # and model_fields_set contains the field + if self.boundary is None and "boundary" in self.model_fields_set: + _dict['boundary'] = None + + return _dict - object = kwargs.get('object', "DocketEntry") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocketEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'DocketEntry', + "sortOrder": obj.get("sortOrder"), + "docketEntryDate": obj.get("docketEntryDate"), + "docketNumber": obj.get("docketNumber"), + "docketBadge": obj.get("docketBadge"), + "text": obj.get("text"), + "textStructured": SourceStructuredData.from_dict(obj["textStructured"]) if obj.get("textStructured") is not None else None, + "referencedDocketNumberArray": [ReferencedDocketNumber.from_dict(_item) for _item in obj["referencedDocketNumberArray"]] if obj.get("referencedDocketNumberArray") is not None else None, + "docketEntryPrimaryDocuments": DocketEntryPrimaryDocuments.from_dict(obj["docketEntryPrimaryDocuments"]) if obj.get("docketEntryPrimaryDocuments") is not None else None, + "docketEntrySecondaryDocuments": DocketEntrySecondaryDocuments.from_dict(obj["docketEntrySecondaryDocuments"]) if obj.get("docketEntrySecondaryDocuments") is not None else None, + "lastFetchDate": obj.get("lastFetchDate"), + "boundary": obj.get("boundary") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.sort_order = sort_order - self.docket_entry_date = docket_entry_date - self.docket_number = docket_number - self.docket_badge = docket_badge - self.text = text - self.text_structured = text_structured - self.referenced_docket_number_array = referenced_docket_number_array - self.docket_entry_primary_documents = docket_entry_primary_documents - self.docket_entry_secondary_documents = docket_entry_secondary_documents - self.last_fetch_date = last_fetch_date - self.boundary = boundary - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/docket_entry_primary_documents.py b/unicourt/model/docket_entry_primary_documents.py index b81db4d..83aae7d 100644 --- a/unicourt/model/docket_entry_primary_documents.py +++ b/unicourt/model/docket_entry_primary_documents.py @@ -1,317 +1,111 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.case_document import CaseDocument - globals()['CaseDocument'] = CaseDocument +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class DocketEntryPrimaryDocuments(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_document import CaseDocument +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class DocketEntryPrimaryDocuments(BaseModel): """ + Primary Documents refers to documents that are directly related to a docket entry. Primary Documents could be specific to a courts or case type in courts. For isntance the below example is in PACER. PACER District Courts - Here the primary document is one which is attached to the docket number. Because in district for a primary document it can have many attachments associatated to it. PACER Appeal Courts - Here the attachments for a docket entry are the primary documents. Because in appeal for those attachments there is no primary documents. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=27, strict=True, max_length=27)]] = Field(default='DocketEntryPrimaryDocuments', description="Name of the object") + page_number: Optional[StrictInt] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + case_document_array: Optional[Annotated[List[CaseDocument], Field(max_length=100)]] = Field(default=None, alias="caseDocumentArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to next page of a particular entity in a Case.", alias="nextPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects of a party in the Case.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of parties of the Case. entity in a Case.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "pageNumber", "caseDocumentArray", "nextPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 27, - 'min_length': 27, - }, - ('case_document_array',): { - 'max_items': 100, - }, - ('next_page_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocketEntryPrimaryDocuments from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'case_document_array': ([CaseDocument],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'case_document_array': 'caseDocumentArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in case_document_array (list) + _items = [] + if self.case_document_array: + for _item in self.case_document_array: + if _item: + _items.append(_item.to_dict()) + _dict['caseDocumentArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, page_number, case_document_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """DocketEntryPrimaryDocuments - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - case_document_array ([CaseDocument]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case. entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "DocketEntryPrimaryDocuments" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "DocketEntryPrimaryDocuments") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.page_number = page_number - self.case_document_array = case_document_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, page_number, case_document_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """DocketEntryPrimaryDocuments - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - case_document_array ([CaseDocument]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case. entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "DocketEntryPrimaryDocuments" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocketEntryPrimaryDocuments from a dict""" + if obj is None: + return None - object = kwargs.get('object', "DocketEntryPrimaryDocuments") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'DocketEntryPrimaryDocuments', + "pageNumber": obj.get("pageNumber"), + "caseDocumentArray": [CaseDocument.from_dict(_item) for _item in obj["caseDocumentArray"]] if obj.get("caseDocumentArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.page_number = page_number - self.case_document_array = case_document_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/docket_entry_secondary_documents.py b/unicourt/model/docket_entry_secondary_documents.py index 4c791f4..56c49f8 100644 --- a/unicourt/model/docket_entry_secondary_documents.py +++ b/unicourt/model/docket_entry_secondary_documents.py @@ -1,317 +1,111 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.case_document import CaseDocument - globals()['CaseDocument'] = CaseDocument +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class DocketEntrySecondaryDocuments(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_document import CaseDocument +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class DocketEntrySecondaryDocuments(BaseModel): """ + Secondary Documents refers to documents that are attached to a docket entry. Secondary Documents could be specific to a courts or case type in courts. For isntance the below example is in PACER. PACER District Courts - Here the secondary document is one which is attached in the docket entry. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=29, strict=True, max_length=29)]] = Field(default='DocketEntrySecondaryDocuments', description="Name of the object") + page_number: Optional[StrictInt] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + case_document_array: Optional[Annotated[List[CaseDocument], Field(max_length=100)]] = Field(default=None, alias="caseDocumentArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to next page of a particular entity in a Case.", alias="nextPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects of a party in the Case.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of parties of the Case. entity in a Case.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "pageNumber", "caseDocumentArray", "nextPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 29, - 'min_length': 29, - }, - ('case_document_array',): { - 'max_items': 100, - }, - ('next_page_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocketEntrySecondaryDocuments from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'case_document_array': ([CaseDocument],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'case_document_array': 'caseDocumentArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in case_document_array (list) + _items = [] + if self.case_document_array: + for _item in self.case_document_array: + if _item: + _items.append(_item.to_dict()) + _dict['caseDocumentArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, page_number, case_document_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """DocketEntrySecondaryDocuments - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - case_document_array ([CaseDocument]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case. entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "DocketEntrySecondaryDocuments" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "DocketEntrySecondaryDocuments") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.page_number = page_number - self.case_document_array = case_document_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, page_number, case_document_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """DocketEntrySecondaryDocuments - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - case_document_array ([CaseDocument]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case. entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "DocketEntrySecondaryDocuments" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocketEntrySecondaryDocuments from a dict""" + if obj is None: + return None - object = kwargs.get('object', "DocketEntrySecondaryDocuments") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'DocketEntrySecondaryDocuments', + "pageNumber": obj.get("pageNumber"), + "caseDocumentArray": [CaseDocument.from_dict(_item) for _item in obj["caseDocumentArray"]] if obj.get("caseDocumentArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.page_number = page_number - self.case_document_array = case_document_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/document_download.py b/unicourt/model/document_download.py index 6e237a5..6773967 100644 --- a/unicourt/model/document_download.py +++ b/unicourt/model/document_download.py @@ -1,327 +1,117 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.exception import Exception - globals()['Exception'] = Exception +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class DocumentDownload(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.exception import Exception +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class DocumentDownload(BaseModel): """ + DocumentDownload + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=16, strict=True, max_length=16)]] = Field(default='DocumentDownload', description="Name of the object.") + case_document_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Requested Document ID.", alias="caseDocumentId") + expiry_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="Expiry date-time for the fileUrl provided in this object.", alias="expiryDate") + file_url: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field(default=None, description="Link to download the file.", alias="fileUrl") + case_document_download_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field(default=None, description="API call to download the document again if the above fileUrl is expired.", alias="caseDocumentDownloadAPI") + exception: Optional[Exception] = None + __properties: ClassVar[List[str]] = ["object", "caseDocumentId", "expiryDate", "fileUrl", "caseDocumentDownloadAPI", "exception"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 16, - 'min_length': 16, - }, - ('case_document_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('expiry_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('file_url',): { - 'max_length': 1024, - 'min_length': 1, - }, - ('case_document_download_api',): { - 'max_length': 1024, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DocumentDownload from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_document_id': (str,), # noqa: E501 - 'expiry_date': (str, none_type,), # noqa: E501 - 'file_url': (str, none_type,), # noqa: E501 - 'case_document_download_api': (str, none_type,), # noqa: E501 - 'exception': (Exception,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_document_id': 'caseDocumentId', # noqa: E501 - 'expiry_date': 'expiryDate', # noqa: E501 - 'file_url': 'fileUrl', # noqa: E501 - 'case_document_download_api': 'caseDocumentDownloadAPI', # noqa: E501 - 'exception': 'exception', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of exception + if self.exception: + _dict['exception'] = self.exception.to_dict() + # set to None if expiry_date (nullable) is None + # and model_fields_set contains the field + if self.expiry_date is None and "expiry_date" in self.model_fields_set: + _dict['expiryDate'] = None + + # set to None if file_url (nullable) is None + # and model_fields_set contains the field + if self.file_url is None and "file_url" in self.model_fields_set: + _dict['fileUrl'] = None + + # set to None if case_document_download_api (nullable) is None + # and model_fields_set contains the field + if self.case_document_download_api is None and "case_document_download_api" in self.model_fields_set: + _dict['caseDocumentDownloadAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_document_id, expiry_date, file_url, case_document_download_api, exception, *args, **kwargs): # noqa: E501 - """DocumentDownload - a model defined in OpenAPI - - Args: - case_document_id (str): Requested Document ID. - expiry_date (str, none_type): Expiry date-time for the fileUrl provided in this object. - file_url (str, none_type): Link to download the file. - case_document_download_api (str, none_type): API call to download the document again if the above fileUrl is expired. - exception (Exception): - - Keyword Args: - object (str): Name of the object.. defaults to "DocumentDownload" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "DocumentDownload") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.case_document_id = case_document_id - self.expiry_date = expiry_date - self.file_url = file_url - self.case_document_download_api = case_document_download_api - self.exception = exception - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, case_document_id, expiry_date, file_url, case_document_download_api, exception, *args, **kwargs): # noqa: E501 - """DocumentDownload - a model defined in OpenAPI - - Args: - case_document_id (str): Requested Document ID. - expiry_date (str, none_type): Expiry date-time for the fileUrl provided in this object. - file_url (str, none_type): Link to download the file. - case_document_download_api (str, none_type): API call to download the document again if the above fileUrl is expired. - exception (Exception): - - Keyword Args: - object (str): Name of the object.. defaults to "DocumentDownload" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DocumentDownload from a dict""" + if obj is None: + return None - object = kwargs.get('object', "DocumentDownload") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'DocumentDownload', + "caseDocumentId": obj.get("caseDocumentId"), + "expiryDate": obj.get("expiryDate"), + "fileUrl": obj.get("fileUrl"), + "caseDocumentDownloadAPI": obj.get("caseDocumentDownloadAPI"), + "exception": Exception.from_dict(obj["exception"]) if obj.get("exception") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_document_id = case_document_id - self.expiry_date = expiry_date - self.file_url = file_url - self.case_document_download_api = case_document_download_api - self.exception = exception - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/email.py b/unicourt/model/email.py index c9859ee..9b362d9 100644 --- a/unicourt/model/email.py +++ b/unicourt/model/email.py @@ -1,311 +1,97 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class Email(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class Email(BaseModel): """ + Email object data schema. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=5, strict=True, max_length=5)]] = 'Email' + email_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=100)]] = Field(default=None, description="email id", alias="emailId") + is_visible: Optional[StrictBool] = Field(default=None, description="Boolean indicating if the email is visible or not.", alias="isVisible") + first_fetch_date: Optional[datetime] = Field(default=None, description="Date at which this record is created in UniCourt.", alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, description="Date at which this record was updated in UniCourt.", alias="lastFetchDate") + __properties: ClassVar[List[str]] = ["object", "emailId", "isVisible", "firstFetchDate", "lastFetchDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 5, - 'min_length': 5, - }, - ('email_id',): { - 'max_length': 100, - 'min_length': 1, - }, - ('first_fetch_date',): { - 'max_length': 35, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 35, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Email from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'email_id': (str,), # noqa: E501 - 'is_visible': (bool,), # noqa: E501 - 'first_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'email_id': 'emailId', # noqa: E501 - 'is_visible': 'isVisible', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, email_id, is_visible, first_fetch_date, last_fetch_date, *args, **kwargs): # noqa: E501 - """Email - a model defined in OpenAPI - - Args: - email_id (str): email id - is_visible (bool): Boolean indicating if the email is visible or not. - first_fetch_date (datetime): Date at which this record is created in UniCourt. - last_fetch_date (datetime): Date at which this record was updated in UniCourt. - - Keyword Args: - object (str): defaults to "Email" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "Email") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.email_id = email_id - self.is_visible = is_visible - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, email_id, is_visible, first_fetch_date, last_fetch_date, *args, **kwargs): # noqa: E501 - """Email - a model defined in OpenAPI - - Args: - email_id (str): email id - is_visible (bool): Boolean indicating if the email is visible or not. - first_fetch_date (datetime): Date at which this record is created in UniCourt. - last_fetch_date (datetime): Date at which this record was updated in UniCourt. - - Keyword Args: - object (str): defaults to "Email" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Email from a dict""" + if obj is None: + return None - object = kwargs.get('object', "Email") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Email', + "emailId": obj.get("emailId"), + "isVisible": obj.get("isVisible"), + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.email_id = email_id - self.is_visible = is_visible - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/exception.py b/unicourt/model/exception.py index 4ed427a..6ccac53 100644 --- a/unicourt/model/exception.py +++ b/unicourt/model/exception.py @@ -1,305 +1,94 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class Exception(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class Exception(BaseModel): """ + Exception object contains specific error code and its message related to the API request validation error or error occurred during API request processing. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]] = 'Exception' + code: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=75)]] = Field(default=None, description="Indicates the type of error occured.") + message: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="Indicates the error message that describes the error code.") + details: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="Describes what went wrong.") + __properties: ClassVar[List[str]] = ["object", "code", "message", "details"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 9, - 'min_length': 9, - }, - ('code',): { - 'max_length': 75, - 'min_length': 1, - }, - ('message',): { - 'max_length': 255, - 'min_length': 1, - }, - ('details',): { - 'max_length': 255, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Exception from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'code': (str,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'details': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'code': 'code', # noqa: E501 - 'message': 'message', # noqa: E501 - 'details': 'details', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, code, message, details, *args, **kwargs): # noqa: E501 - """Exception - a model defined in OpenAPI - - Args: - code (str): Indicates the type of error occured. - message (str): Indicates the error message that describes the error code. - details (str): Describes what went wrong. - - Keyword Args: - object (str): defaults to "Exception" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "Exception") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.code = code - self.message = message - self.details = details - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, code, message, details, *args, **kwargs): # noqa: E501 - """Exception - a model defined in OpenAPI - - Args: - code (str): Indicates the type of error occured. - message (str): Indicates the error message that describes the error code. - details (str): Describes what went wrong. - - Keyword Args: - object (str): defaults to "Exception" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Exception from a dict""" + if obj is None: + return None - object = kwargs.get('object', "Exception") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Exception', + "code": obj.get("code"), + "message": obj.get("message"), + "details": obj.get("details") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.code = code - self.message = message - self.details = details - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/export_file.py b/unicourt/model/export_file.py index 9cf8cbc..b02a666 100644 --- a/unicourt/model/export_file.py +++ b/unicourt/model/export_file.py @@ -1,305 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class ExportFile(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class ExportFile(BaseModel): """ + ExportFile + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=10, strict=True, max_length=10)]] = 'ExportFile' + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="Name of the file.") + expiry_date: Optional[datetime] = Field(default=None, description="Expiry date-time for the fileUrl provided in this object.", alias="expiryDate") + file_url: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2048)]] = Field(default=None, description="Link to download the file.", alias="fileUrl") + __properties: ClassVar[List[str]] = ["object", "name", "expiryDate", "fileUrl"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 10, - 'min_length': 10, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('expiry_date',): { - 'max_length': 40, - 'min_length': 10, - }, - ('file_url',): { - 'max_length': 2048, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExportFile from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'expiry_date': (datetime,), # noqa: E501 - 'file_url': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'name': 'name', # noqa: E501 - 'expiry_date': 'expiryDate', # noqa: E501 - 'file_url': 'fileUrl', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, expiry_date, file_url, *args, **kwargs): # noqa: E501 - """ExportFile - a model defined in OpenAPI - - Args: - name (str): Name of the file. - expiry_date (datetime): Expiry date-time for the fileUrl provided in this object. - file_url (str): Link to download the file. - - Keyword Args: - object (str): defaults to "ExportFile" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "ExportFile") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.name = name - self.expiry_date = expiry_date - self.file_url = file_url - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, expiry_date, file_url, *args, **kwargs): # noqa: E501 - """ExportFile - a model defined in OpenAPI - - Args: - name (str): Name of the file. - expiry_date (datetime): Expiry date-time for the fileUrl provided in this object. - file_url (str): Link to download the file. - - Keyword Args: - object (str): defaults to "ExportFile" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExportFile from a dict""" + if obj is None: + return None - object = kwargs.get('object', "ExportFile") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'ExportFile', + "name": obj.get("name"), + "expiryDate": obj.get("expiryDate"), + "fileUrl": obj.get("fileUrl") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.name = name - self.expiry_date = expiry_date - self.file_url = file_url - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/extracted_fields.py b/unicourt/model/extracted_fields.py index 3e8fcba..395f0f7 100644 --- a/unicourt/model/extracted_fields.py +++ b/unicourt/model/extracted_fields.py @@ -1,263 +1,105 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class ExtractedFields(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'key': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class ExtractedFields(BaseModel): + """ + ExtractedFields + """ # noqa: E501 + key: Optional[StrictStr] = Field(default=None, description="This can be an field that is extracted from rawOrderedDataArray on request of different users.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["key"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'key': 'key', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """ExtractedFields - a model defined in OpenAPI - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - key (str, none_type): This can be an field that is extracted from rawOrderedDataArray on request of different users.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ExtractedFields from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if key (nullable) is None + # and model_fields_set contains the field + if self.key is None and "key" in self.model_fields_set: + _dict['key'] = None + + return _dict - @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """ExtractedFields - a model defined in OpenAPI + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ExtractedFields from a dict""" + if obj is None: + return None - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - key (str, none_type): This can be an field that is extracted from rawOrderedDataArray on request of different users.. [optional] # noqa: E501 - """ + if not isinstance(obj, dict): + return cls.model_validate(obj) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _obj = cls.model_validate({ + "key": obj.get("key") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/hearing.py b/unicourt/model/hearing.py index 2fd4bc2..f52a965 100644 --- a/unicourt/model/hearing.py +++ b/unicourt/model/hearing.py @@ -1,335 +1,115 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.source_structured_data import SourceStructuredData - globals()['SourceStructuredData'] = SourceStructuredData - - -class Hearing(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 7, - 'min_length': 7, - }, - ('hearing_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('hearing_description',): { - 'max_length': 100000, - }, - ('location',): { - 'max_length': 250, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'hearing_date': (datetime,), # noqa: E501 - 'hearing_description': (str, none_type,), # noqa: E501 - 'hearing_structured': (SourceStructuredData,), # noqa: E501 - 'location': (str, none_type,), # noqa: E501 - 'first_fetch_date': (str,), # noqa: E501 - 'last_fetch_date': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'hearing_date': 'hearingDate', # noqa: E501 - 'hearing_description': 'hearingDescription', # noqa: E501 - 'hearing_structured': 'hearingStructured', # noqa: E501 - 'location': 'location', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.source_structured_data import SourceStructuredData +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class Hearing(BaseModel): + """ + Hearing + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=7)]] = Field(default='Hearing', description="Name of the object") + hearing_date: Optional[datetime] = Field(default=None, description="Hearing Date", alias="hearingDate") + hearing_description: Optional[StrictStr] = Field(default=None, description="Source Hearing Description Text", alias="hearingDescription") + hearing_structured: Optional[SourceStructuredData] = Field(default=None, alias="hearingStructured") + location: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="Location where the hearing will takeplace.") + first_fetch_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="When this hearing was first fetched from the source.", alias="firstFetchDate") + last_fetch_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="When this hearing was last fetched from the source.", alias="lastFetchDate") + __properties: ClassVar[List[str]] = ["object", "hearingDate", "hearingDescription", "hearingStructured", "location", "firstFetchDate", "lastFetchDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, hearing_date, hearing_description, hearing_structured, location, first_fetch_date, last_fetch_date, *args, **kwargs): # noqa: E501 - """Hearing - a model defined in OpenAPI - - Args: - hearing_date (datetime): Hearing Date - hearing_description (str, none_type): Source Hearing Description Text - hearing_structured (SourceStructuredData): - location (str, none_type): Location where the hearing will takeplace. - first_fetch_date (str): When this hearing was first fetched from the source. - last_fetch_date (str): When this hearing was last fetched from the source. - - Keyword Args: - object (str): Name of the object. defaults to "Hearing" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "Hearing") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Hearing from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.hearing_date = hearing_date - self.hearing_description = hearing_description - self.hearing_structured = hearing_structured - self.location = location - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, hearing_date, hearing_description, hearing_structured, location, first_fetch_date, last_fetch_date, *args, **kwargs): # noqa: E501 - """Hearing - a model defined in OpenAPI - - Args: - hearing_date (datetime): Hearing Date - hearing_description (str, none_type): Source Hearing Description Text - hearing_structured (SourceStructuredData): - location (str, none_type): Location where the hearing will takeplace. - first_fetch_date (str): When this hearing was first fetched from the source. - last_fetch_date (str): When this hearing was last fetched from the source. - - Keyword Args: - object (str): Name of the object. defaults to "Hearing" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of hearing_structured + if self.hearing_structured: + _dict['hearingStructured'] = self.hearing_structured.to_dict() + # set to None if hearing_description (nullable) is None + # and model_fields_set contains the field + if self.hearing_description is None and "hearing_description" in self.model_fields_set: + _dict['hearingDescription'] = None + + # set to None if location (nullable) is None + # and model_fields_set contains the field + if self.location is None and "location" in self.model_fields_set: + _dict['location'] = None + + return _dict - object = kwargs.get('object', "Hearing") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Hearing from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Hearing', + "hearingDate": obj.get("hearingDate"), + "hearingDescription": obj.get("hearingDescription"), + "hearingStructured": SourceStructuredData.from_dict(obj["hearingStructured"]) if obj.get("hearingStructured") is not None else None, + "location": obj.get("location"), + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.hearing_date = hearing_date - self.hearing_description = hearing_description - self.hearing_structured = hearing_structured - self.location = location - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/hearings.py b/unicourt/model/hearings.py index 31fc5b5..214ad9e 100644 --- a/unicourt/model/hearings.py +++ b/unicourt/model/hearings.py @@ -1,314 +1,111 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.hearing import Hearing - globals()['Hearing'] = Hearing +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class Hearings(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.hearing import Hearing +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class Hearings(BaseModel): """ + Hearings + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=8, strict=True, max_length=8)]] = Field(default='Hearings', description="Name of the object") + page_number: Optional[StrictInt] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + hearing_array: Optional[List[Hearing]] = Field(default=None, alias="hearingArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to next page of a particular entity in a Case.", alias="nextPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects of a party in the Case.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of parties of the Case entity in a Case.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "pageNumber", "hearingArray", "nextPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 8, - 'min_length': 8, - }, - ('next_page_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Hearings from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'hearing_array': ([Hearing],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'hearing_array': 'hearingArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in hearing_array (list) + _items = [] + if self.hearing_array: + for _item in self.hearing_array: + if _item: + _items.append(_item.to_dict()) + _dict['hearingArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, page_number, hearing_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """Hearings - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - hearing_array ([Hearing]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "Hearings" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "Hearings") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.page_number = page_number - self.hearing_array = hearing_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, page_number, hearing_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """Hearings - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - hearing_array ([Hearing]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "Hearings" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Hearings from a dict""" + if obj is None: + return None - object = kwargs.get('object', "Hearings") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Hearings', + "pageNumber": obj.get("pageNumber"), + "hearingArray": [Hearing.from_dict(_item) for _item in obj["hearingArray"]] if obj.get("hearingArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.page_number = page_number - self.hearing_array = hearing_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/individual.py b/unicourt/model/individual.py index f1dd106..bb97749 100644 --- a/unicourt/model/individual.py +++ b/unicourt/model/individual.py @@ -1,299 +1,114 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class Individual(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class Individual(BaseModel): """ + * Only applicable if the Party is an Individual. + """ # noqa: E501 + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + first_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="firstName") + middle_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="middleName") + last_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="lastName") + __properties: ClassVar[List[str]] = ["name", "firstName", "middleName", "lastName"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('name',): { - 'max_length': 500, - }, - ('first_name',): { - 'max_length': 500, - }, - ('middle_name',): { - 'max_length': 500, - }, - ('last_name',): { - 'max_length': 500, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Individual from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'name': (str, none_type,), # noqa: E501 - 'first_name': (str, none_type,), # noqa: E501 - 'middle_name': (str, none_type,), # noqa: E501 - 'last_name': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name': 'name', # noqa: E501 - 'first_name': 'firstName', # noqa: E501 - 'middle_name': 'middleName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['firstName'] = None + + # set to None if middle_name (nullable) is None + # and model_fields_set contains the field + if self.middle_name is None and "middle_name" in self.model_fields_set: + _dict['middleName'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['lastName'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, first_name, middle_name, last_name, *args, **kwargs): # noqa: E501 - """Individual - a model defined in OpenAPI - - Args: - name (str, none_type): - first_name (str, none_type): - middle_name (str, none_type): - last_name (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, first_name, middle_name, last_name, *args, **kwargs): # noqa: E501 - """Individual - a model defined in OpenAPI - - Args: - name (str, none_type): - first_name (str, none_type): - middle_name (str, none_type): - last_name (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Individual from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "firstName": obj.get("firstName"), + "middleName": obj.get("middleName"), + "lastName": obj.get("lastName") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.name = name - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/invalidate_access_token_request.py b/unicourt/model/invalidate_access_token_request.py index fc2c489..37b9773 100644 --- a/unicourt/model/invalidate_access_token_request.py +++ b/unicourt/model/invalidate_access_token_request.py @@ -1,293 +1,92 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class InvalidateAccessTokenRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('client_id',): { - 'max_length': 32, - 'min_length': 32, - }, - ('client_secret',): { - 'max_length': 64, - 'min_length': 64, - }, - ('token_id',): { - 'max_length': 18, - 'min_length': 18, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'client_id': (str,), # noqa: E501 - 'client_secret': (str,), # noqa: E501 - 'token_id': (str,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class InvalidateAccessTokenRequest(BaseModel): + """ + InvalidateAccessTokenRequest + """ # noqa: E501 + client_id: Annotated[str, Field(min_length=32, strict=True, max_length=32)] = Field(description="Your Client ID obtainable by logging into your UniCourt account.", alias="clientId") + client_secret: Annotated[str, Field(min_length=64, strict=True, max_length=64)] = Field(description="Your Client Secret ID obtainable by logging into your UniCourt account.", alias="clientSecret") + token_id: Annotated[str, Field(min_length=18, strict=True, max_length=18)] = Field(description="The Token ID of token being invalidated", alias="tokenId") + __properties: ClassVar[List[str]] = ["clientId", "clientSecret", "tokenId"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'client_id': 'clientId', # noqa: E501 - 'client_secret': 'clientSecret', # noqa: E501 - 'token_id': 'tokenId', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, client_id, client_secret, token_id, *args, **kwargs): # noqa: E501 - """InvalidateAccessTokenRequest - a model defined in OpenAPI - - Args: - client_id (str): Your Client ID obtainable by logging into your UniCourt account. - client_secret (str): Your Client Secret ID obtainable by logging into your UniCourt account. - token_id (str): The Token ID of token being invalidated - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InvalidateAccessTokenRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.client_id = client_id - self.client_secret = client_secret - self.token_id = token_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, client_id, client_secret, token_id, *args, **kwargs): # noqa: E501 - """InvalidateAccessTokenRequest - a model defined in OpenAPI + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - Args: - client_id (str): Your Client ID obtainable by logging into your UniCourt account. - client_secret (str): Your Client Secret ID obtainable by logging into your UniCourt account. - token_id (str): The Token ID of token being invalidated + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InvalidateAccessTokenRequest from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "clientId": obj.get("clientId"), + "clientSecret": obj.get("clientSecret"), + "tokenId": obj.get("tokenId") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.client_id = client_id - self.client_secret = client_secret - self.token_id = token_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/judge.py b/unicourt/model/judge.py index e99bfa6..7711432 100644 --- a/unicourt/model/judge.py +++ b/unicourt/model/judge.py @@ -1,403 +1,158 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.contact import Contact - from unicourt.model.judge_type import JudgeType - from unicourt.model.possible_norm_judge import PossibleNormJudge - globals()['Contact'] = Contact - globals()['JudgeType'] = JudgeType - globals()['PossibleNormJudge'] = PossibleNormJudge - - -class Judge(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 5, - 'min_length': 5, - }, - ('judge_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 250, - 'min_length': 1, - }, - ('name_prefix',): { - 'max_length': 10, - }, - ('first_name',): { - 'max_length': 250, - }, - ('middle_name',): { - 'max_length': 100, - }, - ('last_name',): { - 'max_length': 100, - }, - ('name_suffix',): { - 'max_length': 10, - }, - ('source_judge_type',): { - 'max_length': 50, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'judge_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'name_prefix': (str, none_type,), # noqa: E501 - 'first_name': (str, none_type,), # noqa: E501 - 'middle_name': (str, none_type,), # noqa: E501 - 'last_name': (str, none_type,), # noqa: E501 - 'name_suffix': (str, none_type,), # noqa: E501 - 'contact': (Contact,), # noqa: E501 - 'judge_type': (JudgeType,), # noqa: E501 - 'source_judge_type': (str,), # noqa: E501 - 'is_visible': (bool,), # noqa: E501 - 'first_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date': (datetime,), # noqa: E501 - 'possible_norm_judge_array': ([PossibleNormJudge],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'judge_id': 'judgeId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'name_prefix': 'namePrefix', # noqa: E501 - 'first_name': 'firstName', # noqa: E501 - 'middle_name': 'middleName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - 'name_suffix': 'nameSuffix', # noqa: E501 - 'contact': 'contact', # noqa: E501 - 'judge_type': 'judgeType', # noqa: E501 - 'source_judge_type': 'sourceJudgeType', # noqa: E501 - 'is_visible': 'isVisible', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'possible_norm_judge_array': 'possibleNormJudgeArray', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.contact import Contact +from unicourt.model.judge_type import JudgeType +from unicourt.model.possible_norm_judge import PossibleNormJudge +from typing import Optional, Set +from typing_extensions import Self + +class Judge(BaseModel): + """ + Judge + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=5, strict=True, max_length=5)]] = Field(default='Judge', description="Name of the object") + judge_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="ID for the judge in this case. This ID is unique within a case and NOT across cases. If the same Judge were to appear in another case this ID would be different.", alias="judgeId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=250)]] = Field(default=None, description="Name of the judge as provided by Court.") + name_prefix: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, alias="namePrefix") + first_name: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="First name of the judge. This is normalized by UniCourt.", alias="firstName") + middle_name: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Middle name of the judge. This is normalized by UniCourt.", alias="middleName") + last_name: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Last name of the judge. This is normalized by UniCourt.", alias="lastName") + name_suffix: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, alias="nameSuffix") + contact: Optional[Contact] = None + judge_type: Optional[JudgeType] = Field(default=None, alias="judgeType") + source_judge_type: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, alias="sourceJudgeType") + is_visible: Optional[StrictBool] = Field(default=None, description="Signifies if the judge as this judge type is currently isVisible or not for the case.", alias="isVisible") + first_fetch_date: Optional[datetime] = Field(default=None, description="When was the judge first fetched from the court site.", alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, description="When was the judge last fetched from the court site.", alias="lastFetchDate") + possible_norm_judge_array: Optional[List[PossibleNormJudge]] = Field(default=None, alias="possibleNormJudgeArray") + __properties: ClassVar[List[str]] = ["object", "judgeId", "name", "namePrefix", "firstName", "middleName", "lastName", "nameSuffix", "contact", "judgeType", "sourceJudgeType", "isVisible", "firstFetchDate", "lastFetchDate", "possibleNormJudgeArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, judge_id, name, name_prefix, first_name, middle_name, last_name, name_suffix, contact, judge_type, source_judge_type, is_visible, first_fetch_date, last_fetch_date, possible_norm_judge_array, *args, **kwargs): # noqa: E501 - """Judge - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Judge from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - judge_id (str): ID for the judge in this case. This ID is unique within a case and NOT across cases. If the same Judge were to appear in another case this ID would be different. - name (str): Name of the judge as provided by Court. - name_prefix (str, none_type): - first_name (str, none_type): First name of the judge. This is normalized by UniCourt. - middle_name (str, none_type): Middle name of the judge. This is normalized by UniCourt. - last_name (str, none_type): Last name of the judge. This is normalized by UniCourt. - name_suffix (str, none_type): - contact (Contact): - judge_type (JudgeType): - source_judge_type (str): - is_visible (bool): Signifies if the judge as this judge type is currently isVisible or not for the case. - first_fetch_date (datetime): When was the judge first fetched from the court site. - last_fetch_date (datetime): When was the judge last fetched from the court site. - possible_norm_judge_array ([PossibleNormJudge]): - - Keyword Args: - object (str): Name of the object. defaults to "Judge" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "Judge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.judge_id = judge_id - self.name = name - self.name_prefix = name_prefix - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.name_suffix = name_suffix - self.contact = contact - self.judge_type = judge_type - self.source_judge_type = source_judge_type - self.is_visible = is_visible - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.possible_norm_judge_array = possible_norm_judge_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, judge_id, name, name_prefix, first_name, middle_name, last_name, name_suffix, contact, judge_type, source_judge_type, is_visible, first_fetch_date, last_fetch_date, possible_norm_judge_array, *args, **kwargs): # noqa: E501 - """Judge - a model defined in OpenAPI - - Args: - judge_id (str): ID for the judge in this case. This ID is unique within a case and NOT across cases. If the same Judge were to appear in another case this ID would be different. - name (str): Name of the judge as provided by Court. - name_prefix (str, none_type): - first_name (str, none_type): First name of the judge. This is normalized by UniCourt. - middle_name (str, none_type): Middle name of the judge. This is normalized by UniCourt. - last_name (str, none_type): Last name of the judge. This is normalized by UniCourt. - name_suffix (str, none_type): - contact (Contact): - judge_type (JudgeType): - source_judge_type (str): - is_visible (bool): Signifies if the judge as this judge type is currently isVisible or not for the case. - first_fetch_date (datetime): When was the judge first fetched from the court site. - last_fetch_date (datetime): When was the judge last fetched from the court site. - possible_norm_judge_array ([PossibleNormJudge]): - - Keyword Args: - object (str): Name of the object. defaults to "Judge" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of contact + if self.contact: + _dict['contact'] = self.contact.to_dict() + # override the default output from pydantic by calling `to_dict()` of judge_type + if self.judge_type: + _dict['judgeType'] = self.judge_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in possible_norm_judge_array (list) + _items = [] + if self.possible_norm_judge_array: + for _item in self.possible_norm_judge_array: + if _item: + _items.append(_item.to_dict()) + _dict['possibleNormJudgeArray'] = _items + # set to None if name_prefix (nullable) is None + # and model_fields_set contains the field + if self.name_prefix is None and "name_prefix" in self.model_fields_set: + _dict['namePrefix'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['firstName'] = None + + # set to None if middle_name (nullable) is None + # and model_fields_set contains the field + if self.middle_name is None and "middle_name" in self.model_fields_set: + _dict['middleName'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['lastName'] = None + + # set to None if name_suffix (nullable) is None + # and model_fields_set contains the field + if self.name_suffix is None and "name_suffix" in self.model_fields_set: + _dict['nameSuffix'] = None + + return _dict - object = kwargs.get('object', "Judge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Judge from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Judge', + "judgeId": obj.get("judgeId"), + "name": obj.get("name"), + "namePrefix": obj.get("namePrefix"), + "firstName": obj.get("firstName"), + "middleName": obj.get("middleName"), + "lastName": obj.get("lastName"), + "nameSuffix": obj.get("nameSuffix"), + "contact": Contact.from_dict(obj["contact"]) if obj.get("contact") is not None else None, + "judgeType": JudgeType.from_dict(obj["judgeType"]) if obj.get("judgeType") is not None else None, + "sourceJudgeType": obj.get("sourceJudgeType"), + "isVisible": obj.get("isVisible"), + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate"), + "possibleNormJudgeArray": [PossibleNormJudge.from_dict(_item) for _item in obj["possibleNormJudgeArray"]] if obj.get("possibleNormJudgeArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.judge_id = judge_id - self.name = name - self.name_prefix = name_prefix - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.name_suffix = name_suffix - self.contact = contact - self.judge_type = judge_type - self.source_judge_type = source_judge_type - self.is_visible = is_visible - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.possible_norm_judge_array = possible_norm_judge_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/judge_analytics_api.py b/unicourt/model/judge_analytics_api.py index c9a2947..182135a 100644 --- a/unicourt/model/judge_analytics_api.py +++ b/unicourt/model/judge_analytics_api.py @@ -1,310 +1,96 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class JudgeAnalyticsAPI(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class JudgeAnalyticsAPI(BaseModel): """ + JudgeAnalyticsAPI + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=17)]] = 'JudgeAnalyticsAPI' + norm_judge_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to Details for the Judge.", alias="normJudgeAPI") + associated_norm_attorneys_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormAttorneysAPI") + associated_norm_law_firms_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormLawFirmsAPI") + associated_norm_parties_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormPartiesAPI") + __properties: ClassVar[List[str]] = ["object", "normJudgeAPI", "associatedNormAttorneysAPI", "associatedNormLawFirmsAPI", "associatedNormPartiesAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 17, - }, - ('norm_judge_api',): { - 'max_length': 255, - }, - ('associated_norm_attorneys_api',): { - 'max_length': 255, - }, - ('associated_norm_law_firms_api',): { - 'max_length': 255, - }, - ('associated_norm_parties_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JudgeAnalyticsAPI from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'norm_judge_api': (str,), # noqa: E501 - 'associated_norm_attorneys_api': (str,), # noqa: E501 - 'associated_norm_law_firms_api': (str,), # noqa: E501 - 'associated_norm_parties_api': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_judge_api': 'normJudgeAPI', # noqa: E501 - 'associated_norm_attorneys_api': 'associatedNormAttorneysAPI', # noqa: E501 - 'associated_norm_law_firms_api': 'associatedNormLawFirmsAPI', # noqa: E501 - 'associated_norm_parties_api': 'associatedNormPartiesAPI', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_judge_api, associated_norm_attorneys_api, associated_norm_law_firms_api, associated_norm_parties_api, *args, **kwargs): # noqa: E501 - """JudgeAnalyticsAPI - a model defined in OpenAPI - - Args: - norm_judge_api (str): Link to Details for the Judge. - associated_norm_attorneys_api (str): - associated_norm_law_firms_api (str): - associated_norm_parties_api (str): - - Keyword Args: - object (str): defaults to "JudgeAnalyticsAPI" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "JudgeAnalyticsAPI") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_judge_api = norm_judge_api - self.associated_norm_attorneys_api = associated_norm_attorneys_api - self.associated_norm_law_firms_api = associated_norm_law_firms_api - self.associated_norm_parties_api = associated_norm_parties_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_judge_api, associated_norm_attorneys_api, associated_norm_law_firms_api, associated_norm_parties_api, *args, **kwargs): # noqa: E501 - """JudgeAnalyticsAPI - a model defined in OpenAPI - - Args: - norm_judge_api (str): Link to Details for the Judge. - associated_norm_attorneys_api (str): - associated_norm_law_firms_api (str): - associated_norm_parties_api (str): - - Keyword Args: - object (str): defaults to "JudgeAnalyticsAPI" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JudgeAnalyticsAPI from a dict""" + if obj is None: + return None - object = kwargs.get('object', "JudgeAnalyticsAPI") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'JudgeAnalyticsAPI', + "normJudgeAPI": obj.get("normJudgeAPI"), + "associatedNormAttorneysAPI": obj.get("associatedNormAttorneysAPI"), + "associatedNormLawFirmsAPI": obj.get("associatedNormLawFirmsAPI"), + "associatedNormPartiesAPI": obj.get("associatedNormPartiesAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_judge_api = norm_judge_api - self.associated_norm_attorneys_api = associated_norm_attorneys_api - self.associated_norm_law_firms_api = associated_norm_law_firms_api - self.associated_norm_parties_api = associated_norm_parties_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/judge_type.py b/unicourt/model/judge_type.py index b924234..41a967a 100644 --- a/unicourt/model/judge_type.py +++ b/unicourt/model/judge_type.py @@ -1,305 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class JudgeType(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class JudgeType(BaseModel): """ + JudgeType + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]] = 'JudgeType' + judge_type_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="judgeTypeId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "judgeTypeId", "name", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 9, - 'min_length': 9, - }, - ('judge_type_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JudgeType from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'judge_type_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'judge_type_id': 'judgeTypeId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, judge_type_id, name, created_date, *args, **kwargs): # noqa: E501 - """JudgeType - a model defined in OpenAPI - - Args: - judge_type_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "JudgeType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "JudgeType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.judge_type_id = judge_type_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, judge_type_id, name, created_date, *args, **kwargs): # noqa: E501 - """JudgeType - a model defined in OpenAPI - - Args: - judge_type_id (str): - name (str): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "JudgeType" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JudgeType from a dict""" + if obj is None: + return None - object = kwargs.get('object', "JudgeType") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'JudgeType', + "judgeTypeId": obj.get("judgeTypeId"), + "name": obj.get("name"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.judge_type_id = judge_type_id - self.name = name - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/judge_type_response.py b/unicourt/model/judge_type_response.py index 770ad15..0af06bd 100644 --- a/unicourt/model/judge_type_response.py +++ b/unicourt/model/judge_type_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.judge_type import JudgeType - globals()['JudgeType'] = JudgeType - - -class JudgeTypeResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 17, - 'min_length': 17, - }, - ('judge_type_array',): { - }, - ('next_page_api',): { - 'max_length': 2142, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2141, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'judge_type_array': ([JudgeType],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'judge_type_array': 'judgeTypeArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.judge_type import JudgeType +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class JudgeTypeResponse(BaseModel): + """ + JudgeTypeResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=17)]] = 'JudgeTypeResponse' + judge_type_array: Optional[List[JudgeType]] = Field(default=None, alias="judgeTypeArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2142)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2141)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "judgeTypeArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, judge_type_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """JudgeTypeResponse - a model defined in OpenAPI - - Args: - judge_type_array ([JudgeType]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "JudgeTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "JudgeTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JudgeTypeResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.judge_type_array = judge_type_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, judge_type_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """JudgeTypeResponse - a model defined in OpenAPI - - Args: - judge_type_array ([JudgeType]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "JudgeTypeResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in judge_type_array (list) + _items = [] + if self.judge_type_array: + for _item in self.judge_type_array: + if _item: + _items.append(_item.to_dict()) + _dict['judgeTypeArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "JudgeTypeResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JudgeTypeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'JudgeTypeResponse', + "judgeTypeArray": [JudgeType.from_dict(_item) for _item in obj["judgeTypeArray"]] if obj.get("judgeTypeArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.judge_type_array = judge_type_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/judges.py b/unicourt/model/judges.py index b86b20c..d804584 100644 --- a/unicourt/model/judges.py +++ b/unicourt/model/judges.py @@ -1,317 +1,111 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.judge import Judge - globals()['Judge'] = Judge +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class Judges(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.judge import Judge +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class Judges(BaseModel): """ + Judges + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=6, strict=True, max_length=6)]] = Field(default='Judges', description="Name of the object") + page_number: Optional[StrictInt] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + judge_array: Optional[Annotated[List[Judge], Field(max_length=25)]] = Field(default=None, alias="judgeArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to next page of a particular entity in a Case.", alias="nextPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects of a party in the Case.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of parties of the Case entity in a Case.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "pageNumber", "judgeArray", "nextPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 6, - 'min_length': 6, - }, - ('judge_array',): { - 'max_items': 25, - }, - ('next_page_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Judges from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'judge_array': ([Judge],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'judge_array': 'judgeArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in judge_array (list) + _items = [] + if self.judge_array: + for _item in self.judge_array: + if _item: + _items.append(_item.to_dict()) + _dict['judgeArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, page_number, judge_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """Judges - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - judge_array ([Judge]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "Judges" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "Judges") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.page_number = page_number - self.judge_array = judge_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, page_number, judge_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """Judges - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - judge_array ([Judge]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "Judges" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Judges from a dict""" + if obj is None: + return None - object = kwargs.get('object', "Judges") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Judges', + "pageNumber": obj.get("pageNumber"), + "judgeArray": [Judge.from_dict(_item) for _item in obj["judgeArray"]] if obj.get("judgeArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.page_number = page_number - self.judge_array = judge_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/jurisdiction_geo.py b/unicourt/model/jurisdiction_geo.py index e14f4ae..dc0a50c 100644 --- a/unicourt/model/jurisdiction_geo.py +++ b/unicourt/model/jurisdiction_geo.py @@ -1,361 +1,117 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class JurisdictionGeo(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 15, - 'min_length': 15, - }, - ('jurisdiction_geo_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('country',): { - 'max_length': 255, - 'min_length': 1, - }, - ('state',): { - 'max_length': 255, - 'min_length': 1, - }, - ('county',): { - 'max_length': 255, - 'min_length': 1, - }, - ('city',): { - 'max_length': 255, - 'min_length': 1, - }, - ('fips_code',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('courts_for_jurisdiction_geo_api',): { - 'max_length': 255, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'jurisdiction_geo_id': (str,), # noqa: E501 - 'country': (str,), # noqa: E501 - 'state': (str,), # noqa: E501 - 'county': (str, none_type,), # noqa: E501 - 'city': (str, none_type,), # noqa: E501 - 'fips_code': (str,), # noqa: E501 - 'zip_code_array': ([str], none_type,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - 'courts_for_jurisdiction_geo_api': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'jurisdiction_geo_id': 'jurisdictionGeoId', # noqa: E501 - 'country': 'country', # noqa: E501 - 'state': 'state', # noqa: E501 - 'county': 'county', # noqa: E501 - 'city': 'city', # noqa: E501 - 'fips_code': 'fipsCode', # noqa: E501 - 'zip_code_array': 'zipCodeArray', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - 'courts_for_jurisdiction_geo_api': 'courtsForJurisdictionGeoAPI', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class JurisdictionGeo(BaseModel): + """ + JurisdictionGeo + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=15, strict=True, max_length=15)]] = 'JurisdictionGeo' + jurisdiction_geo_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="jurisdictionGeoId") + country: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + state: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + county: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + city: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + fips_code: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="fipsCode") + zip_code_array: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=255)]]] = Field(default=None, alias="zipCodeArray") + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + courts_for_jurisdiction_geo_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="courtsForJurisdictionGeoAPI") + __properties: ClassVar[List[str]] = ["object", "jurisdictionGeoId", "country", "state", "county", "city", "fipsCode", "zipCodeArray", "createdDate", "courtsForJurisdictionGeoAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, jurisdiction_geo_id, country, state, county, city, fips_code, zip_code_array, created_date, courts_for_jurisdiction_geo_api, *args, **kwargs): # noqa: E501 - """JurisdictionGeo - a model defined in OpenAPI - - Args: - jurisdiction_geo_id (str): - country (str): - state (str): - county (str, none_type): - city (str, none_type): - fips_code (str): - zip_code_array ([str], none_type): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - courts_for_jurisdiction_geo_api (str): - - Keyword Args: - object (str): defaults to "JurisdictionGeo" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JurisdictionGeo from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "JurisdictionGeo") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.jurisdiction_geo_id = jurisdiction_geo_id - self.country = country - self.state = state - self.county = county - self.city = city - self.fips_code = fips_code - self.zip_code_array = zip_code_array - self.created_date = created_date - self.courts_for_jurisdiction_geo_api = courts_for_jurisdiction_geo_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, jurisdiction_geo_id, country, state, county, city, fips_code, zip_code_array, created_date, courts_for_jurisdiction_geo_api, *args, **kwargs): # noqa: E501 - """JurisdictionGeo - a model defined in OpenAPI - - Args: - jurisdiction_geo_id (str): - country (str): - state (str): - county (str, none_type): - city (str, none_type): - fips_code (str): - zip_code_array ([str], none_type): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - courts_for_jurisdiction_geo_api (str): - - Keyword Args: - object (str): defaults to "JurisdictionGeo" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if county (nullable) is None + # and model_fields_set contains the field + if self.county is None and "county" in self.model_fields_set: + _dict['county'] = None + + # set to None if city (nullable) is None + # and model_fields_set contains the field + if self.city is None and "city" in self.model_fields_set: + _dict['city'] = None + + return _dict - object = kwargs.get('object', "JurisdictionGeo") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JurisdictionGeo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'JurisdictionGeo', + "jurisdictionGeoId": obj.get("jurisdictionGeoId"), + "country": obj.get("country"), + "state": obj.get("state"), + "county": obj.get("county"), + "city": obj.get("city"), + "fipsCode": obj.get("fipsCode"), + "zipCodeArray": obj.get("zipCodeArray"), + "createdDate": obj.get("createdDate"), + "courtsForJurisdictionGeoAPI": obj.get("courtsForJurisdictionGeoAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.jurisdiction_geo_id = jurisdiction_geo_id - self.country = country - self.state = state - self.county = county - self.city = city - self.fips_code = fips_code - self.zip_code_array = zip_code_array - self.created_date = created_date - self.courts_for_jurisdiction_geo_api = courts_for_jurisdiction_geo_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/jurisdiction_geo_response.py b/unicourt/model/jurisdiction_geo_response.py index ffe3eae..775a31b 100644 --- a/unicourt/model/jurisdiction_geo_response.py +++ b/unicourt/model/jurisdiction_geo_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.jurisdiction_geo import JurisdictionGeo - globals()['JurisdictionGeo'] = JurisdictionGeo - - -class JurisdictionGeoResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 23, - 'min_length': 23, - }, - ('jurisdiction_geo_array',): { - }, - ('next_page_api',): { - 'max_length': 2147, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2146, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'jurisdiction_geo_array': ([JurisdictionGeo],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'jurisdiction_geo_array': 'jurisdictionGeoArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.jurisdiction_geo import JurisdictionGeo +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class JurisdictionGeoResponse(BaseModel): + """ + JurisdictionGeoResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=23, strict=True, max_length=23)]] = 'JurisdictionGeoResponse' + jurisdiction_geo_array: Optional[List[JurisdictionGeo]] = Field(default=None, alias="jurisdictionGeoArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2147)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2146)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "jurisdictionGeoArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, jurisdiction_geo_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """JurisdictionGeoResponse - a model defined in OpenAPI - - Args: - jurisdiction_geo_array ([JurisdictionGeo]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "JurisdictionGeoResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "JurisdictionGeoResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JurisdictionGeoResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.jurisdiction_geo_array = jurisdiction_geo_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, jurisdiction_geo_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """JurisdictionGeoResponse - a model defined in OpenAPI - - Args: - jurisdiction_geo_array ([JurisdictionGeo]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "JurisdictionGeoResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in jurisdiction_geo_array (list) + _items = [] + if self.jurisdiction_geo_array: + for _item in self.jurisdiction_geo_array: + if _item: + _items.append(_item.to_dict()) + _dict['jurisdictionGeoArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "JurisdictionGeoResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JurisdictionGeoResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'JurisdictionGeoResponse', + "jurisdictionGeoArray": [JurisdictionGeo.from_dict(_item) for _item in obj["jurisdictionGeoArray"]] if obj.get("jurisdictionGeoArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.jurisdiction_geo_array = jurisdiction_geo_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/last_tracked_details.py b/unicourt/model/last_tracked_details.py index ad2dfea..d122650 100644 --- a/unicourt/model/last_tracked_details.py +++ b/unicourt/model/last_tracked_details.py @@ -1,305 +1,108 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_update_pacer_options_response import CaseUpdatePacerOptionsResponse - from unicourt.model.exception import Exception - globals()['CaseUpdatePacerOptionsResponse'] = CaseUpdatePacerOptionsResponse - globals()['Exception'] = Exception - - -class LastTrackedDetails(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - validations = { - ('object',): { - 'max_length': 18, - 'min_length': 18, - }, - ('last_track_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_update_pacer_options_response import CaseUpdatePacerOptionsResponse +from unicourt.model.exception import Exception +from typing import Optional, Set +from typing_extensions import Self + +class LastTrackedDetails(BaseModel): + """ + LastTrackedDetails + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default='LastTrackedDetails', description="Name of the object.") + pacer_options: Optional[CaseUpdatePacerOptionsResponse] = Field(default=None, alias="pacerOptions") + last_track_date: Optional[datetime] = Field(default=None, description="The date and time when the case was tracked for this account.", alias="lastTrackDate") + last_track_exception: Optional[Exception] = Field(default=None, alias="lastTrackException") + __properties: ClassVar[List[str]] = ["object", "pacerOptions", "lastTrackDate", "lastTrackException"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LastTrackedDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'pacer_options': (CaseUpdatePacerOptionsResponse,), # noqa: E501 - 'last_track_date': (datetime, none_type,), # noqa: E501 - 'last_track_exception': (Exception,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'pacer_options': 'pacerOptions', # noqa: E501 - 'last_track_date': 'lastTrackDate', # noqa: E501 - 'last_track_exception': 'lastTrackException', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pacer_options + if self.pacer_options: + _dict['pacerOptions'] = self.pacer_options.to_dict() + # override the default output from pydantic by calling `to_dict()` of last_track_exception + if self.last_track_exception: + _dict['lastTrackException'] = self.last_track_exception.to_dict() + # set to None if last_track_date (nullable) is None + # and model_fields_set contains the field + if self.last_track_date is None and "last_track_date" in self.model_fields_set: + _dict['lastTrackDate'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pacer_options, last_track_date, last_track_exception, *args, **kwargs): # noqa: E501 - """LastTrackedDetails - a model defined in OpenAPI - - Args: - pacer_options (CaseUpdatePacerOptionsResponse): - last_track_date (datetime, none_type): The date and time when the case was tracked for this account. - last_track_exception (Exception): - - Keyword Args: - object (str): Name of the object.. defaults to "LastTrackedDetails" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "LastTrackedDetails") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.pacer_options = pacer_options - self.last_track_date = last_track_date - self.last_track_exception = last_track_exception - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, pacer_options, last_track_date, last_track_exception, *args, **kwargs): # noqa: E501 - """LastTrackedDetails - a model defined in OpenAPI - - Args: - pacer_options (CaseUpdatePacerOptionsResponse): - last_track_date (datetime, none_type): The date and time when the case was tracked for this account. - last_track_exception (Exception): - - Keyword Args: - object (str): Name of the object.. defaults to "LastTrackedDetails" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LastTrackedDetails from a dict""" + if obj is None: + return None - object = kwargs.get('object', "LastTrackedDetails") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'LastTrackedDetails', + "pacerOptions": CaseUpdatePacerOptionsResponse.from_dict(obj["pacerOptions"]) if obj.get("pacerOptions") is not None else None, + "lastTrackDate": obj.get("lastTrackDate"), + "lastTrackException": Exception.from_dict(obj["lastTrackException"]) if obj.get("lastTrackException") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.pacer_options = pacer_options - self.last_track_date = last_track_date - self.last_track_exception = last_track_exception - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/law_firm_analytics_api.py b/unicourt/model/law_firm_analytics_api.py index e5da45c..adb862b 100644 --- a/unicourt/model/law_firm_analytics_api.py +++ b/unicourt/model/law_firm_analytics_api.py @@ -1,337 +1,112 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class LawFirmAnalyticsAPI(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 19, - }, - ('norm_law_firm_api',): { - 'max_length': 255, - }, - ('associated_norm_attorney_api',): { - 'max_length': 255, - }, - ('associated_norm_judge_api',): { - 'max_length': 255, - }, - ('associated_norm_parties_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_opposing_norm_attorney_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_opposing_norm_law_firm_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_opposing_norm_party_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'norm_law_firm_api': (str,), # noqa: E501 - 'associated_norm_attorney_api': (str,), # noqa: E501 - 'associated_norm_judge_api': (str,), # noqa: E501 - 'associated_norm_parties_api': (str,), # noqa: E501 - 'case_count_analytics_by_opposing_norm_attorney_api': (str, none_type,), # noqa: E501 - 'case_count_analytics_by_opposing_norm_law_firm_api': (str,), # noqa: E501 - 'case_count_analytics_by_opposing_norm_party_api': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_law_firm_api': 'normLawFirmAPI', # noqa: E501 - 'associated_norm_attorney_api': 'associatedNormAttorneyAPI', # noqa: E501 - 'associated_norm_judge_api': 'associatedNormJudgeAPI', # noqa: E501 - 'associated_norm_parties_api': 'associatedNormPartiesAPI', # noqa: E501 - 'case_count_analytics_by_opposing_norm_attorney_api': 'caseCountAnalyticsByOpposingNormAttorneyAPI', # noqa: E501 - 'case_count_analytics_by_opposing_norm_law_firm_api': 'caseCountAnalyticsByOpposingNormLawFirmAPI', # noqa: E501 - 'case_count_analytics_by_opposing_norm_party_api': 'caseCountAnalyticsByOpposingNormPartyAPI', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class LawFirmAnalyticsAPI(BaseModel): + """ + LawFirmAnalyticsAPI + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=19)]] = 'LawFirmAnalyticsAPI' + norm_law_firm_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to Details for the Law Firm.", alias="normLawFirmAPI") + associated_norm_attorney_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormAttorneyAPI") + associated_norm_judge_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormJudgeAPI") + associated_norm_parties_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormPartiesAPI") + case_count_analytics_by_opposing_norm_attorney_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByOpposingNormAttorneyAPI") + case_count_analytics_by_opposing_norm_law_firm_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByOpposingNormLawFirmAPI") + case_count_analytics_by_opposing_norm_party_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByOpposingNormPartyAPI") + __properties: ClassVar[List[str]] = ["object", "normLawFirmAPI", "associatedNormAttorneyAPI", "associatedNormJudgeAPI", "associatedNormPartiesAPI", "caseCountAnalyticsByOpposingNormAttorneyAPI", "caseCountAnalyticsByOpposingNormLawFirmAPI", "caseCountAnalyticsByOpposingNormPartyAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_law_firm_api, associated_norm_attorney_api, associated_norm_judge_api, associated_norm_parties_api, case_count_analytics_by_opposing_norm_attorney_api, case_count_analytics_by_opposing_norm_law_firm_api, case_count_analytics_by_opposing_norm_party_api, *args, **kwargs): # noqa: E501 - """LawFirmAnalyticsAPI - a model defined in OpenAPI - - Args: - norm_law_firm_api (str): Link to Details for the Law Firm. - associated_norm_attorney_api (str): - associated_norm_judge_api (str): - associated_norm_parties_api (str): - case_count_analytics_by_opposing_norm_attorney_api (str, none_type): - case_count_analytics_by_opposing_norm_law_firm_api (str): - case_count_analytics_by_opposing_norm_party_api (str, none_type): - - Keyword Args: - object (str): defaults to "LawFirmAnalyticsAPI" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LawFirmAnalyticsAPI from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "LawFirmAnalyticsAPI") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_law_firm_api = norm_law_firm_api - self.associated_norm_attorney_api = associated_norm_attorney_api - self.associated_norm_judge_api = associated_norm_judge_api - self.associated_norm_parties_api = associated_norm_parties_api - self.case_count_analytics_by_opposing_norm_attorney_api = case_count_analytics_by_opposing_norm_attorney_api - self.case_count_analytics_by_opposing_norm_law_firm_api = case_count_analytics_by_opposing_norm_law_firm_api - self.case_count_analytics_by_opposing_norm_party_api = case_count_analytics_by_opposing_norm_party_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_law_firm_api, associated_norm_attorney_api, associated_norm_judge_api, associated_norm_parties_api, case_count_analytics_by_opposing_norm_attorney_api, case_count_analytics_by_opposing_norm_law_firm_api, case_count_analytics_by_opposing_norm_party_api, *args, **kwargs): # noqa: E501 - """LawFirmAnalyticsAPI - a model defined in OpenAPI - - Args: - norm_law_firm_api (str): Link to Details for the Law Firm. - associated_norm_attorney_api (str): - associated_norm_judge_api (str): - associated_norm_parties_api (str): - case_count_analytics_by_opposing_norm_attorney_api (str, none_type): - case_count_analytics_by_opposing_norm_law_firm_api (str): - case_count_analytics_by_opposing_norm_party_api (str, none_type): - - Keyword Args: - object (str): defaults to "LawFirmAnalyticsAPI" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if case_count_analytics_by_opposing_norm_attorney_api (nullable) is None + # and model_fields_set contains the field + if self.case_count_analytics_by_opposing_norm_attorney_api is None and "case_count_analytics_by_opposing_norm_attorney_api" in self.model_fields_set: + _dict['caseCountAnalyticsByOpposingNormAttorneyAPI'] = None + + # set to None if case_count_analytics_by_opposing_norm_party_api (nullable) is None + # and model_fields_set contains the field + if self.case_count_analytics_by_opposing_norm_party_api is None and "case_count_analytics_by_opposing_norm_party_api" in self.model_fields_set: + _dict['caseCountAnalyticsByOpposingNormPartyAPI'] = None + + return _dict - object = kwargs.get('object', "LawFirmAnalyticsAPI") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LawFirmAnalyticsAPI from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'LawFirmAnalyticsAPI', + "normLawFirmAPI": obj.get("normLawFirmAPI"), + "associatedNormAttorneyAPI": obj.get("associatedNormAttorneyAPI"), + "associatedNormJudgeAPI": obj.get("associatedNormJudgeAPI"), + "associatedNormPartiesAPI": obj.get("associatedNormPartiesAPI"), + "caseCountAnalyticsByOpposingNormAttorneyAPI": obj.get("caseCountAnalyticsByOpposingNormAttorneyAPI"), + "caseCountAnalyticsByOpposingNormLawFirmAPI": obj.get("caseCountAnalyticsByOpposingNormLawFirmAPI"), + "caseCountAnalyticsByOpposingNormPartyAPI": obj.get("caseCountAnalyticsByOpposingNormPartyAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_law_firm_api = norm_law_firm_api - self.associated_norm_attorney_api = associated_norm_attorney_api - self.associated_norm_judge_api = associated_norm_judge_api - self.associated_norm_parties_api = associated_norm_parties_api - self.case_count_analytics_by_opposing_norm_attorney_api = case_count_analytics_by_opposing_norm_attorney_api - self.case_count_analytics_by_opposing_norm_law_firm_api = case_count_analytics_by_opposing_norm_law_firm_api - self.case_count_analytics_by_opposing_norm_party_api = case_count_analytics_by_opposing_norm_party_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/matched_object.py b/unicourt/model/matched_object.py index 7f30c7b..f907d59 100644 --- a/unicourt/model/matched_object.py +++ b/unicourt/model/matched_object.py @@ -1,325 +1,98 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class MatchedObject(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class MatchedObject(BaseModel): """ + MatchedObject + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=13, strict=True, max_length=13)]] = 'MatchedObject' + matched_object_id: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=18)]] = Field(default=None, alias="matchedObjectId") + matched_object_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="matchedObjectName") + matched_object_attribute: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="matchedObjectAttribute") + highlight_snippet: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=10000)]] = Field(default=None, alias="highlightSnippet") + matched_object_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2048)]] = Field(default=None, alias="matchedObjectAPI") + __properties: ClassVar[List[str]] = ["object", "matchedObjectId", "matchedObjectName", "matchedObjectAttribute", "highlightSnippet", "matchedObjectAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 13, - 'min_length': 13, - }, - ('matched_object_id',): { - 'max_length': 18, - 'min_length': 17, - }, - ('matched_object_name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('matched_object_attribute',): { - 'max_length': 255, - 'min_length': 1, - }, - ('highlight_snippet',): { - 'max_length': 10000, - 'min_length': 1, - }, - ('matched_object_api',): { - 'max_length': 2048, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MatchedObject from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'matched_object_id': (str,), # noqa: E501 - 'matched_object_name': (str,), # noqa: E501 - 'matched_object_attribute': (str,), # noqa: E501 - 'highlight_snippet': (str,), # noqa: E501 - 'matched_object_api': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'matched_object_id': 'matchedObjectId', # noqa: E501 - 'matched_object_name': 'matchedObjectName', # noqa: E501 - 'matched_object_attribute': 'matchedObjectAttribute', # noqa: E501 - 'highlight_snippet': 'highlightSnippet', # noqa: E501 - 'matched_object_api': 'matchedObjectAPI', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, matched_object_id, matched_object_name, matched_object_attribute, highlight_snippet, matched_object_api, *args, **kwargs): # noqa: E501 - """MatchedObject - a model defined in OpenAPI - - Args: - matched_object_id (str): - matched_object_name (str): - matched_object_attribute (str): - highlight_snippet (str): - matched_object_api (str): - - Keyword Args: - object (str): defaults to "MatchedObject" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "MatchedObject") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.matched_object_id = matched_object_id - self.matched_object_name = matched_object_name - self.matched_object_attribute = matched_object_attribute - self.highlight_snippet = highlight_snippet - self.matched_object_api = matched_object_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, matched_object_id, matched_object_name, matched_object_attribute, highlight_snippet, matched_object_api, *args, **kwargs): # noqa: E501 - """MatchedObject - a model defined in OpenAPI - - Args: - matched_object_id (str): - matched_object_name (str): - matched_object_attribute (str): - highlight_snippet (str): - matched_object_api (str): - - Keyword Args: - object (str): defaults to "MatchedObject" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MatchedObject from a dict""" + if obj is None: + return None - object = kwargs.get('object', "MatchedObject") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'MatchedObject', + "matchedObjectId": obj.get("matchedObjectId"), + "matchedObjectName": obj.get("matchedObjectName"), + "matchedObjectAttribute": obj.get("matchedObjectAttribute"), + "highlightSnippet": obj.get("highlightSnippet"), + "matchedObjectAPI": obj.get("matchedObjectAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.matched_object_id = matched_object_id - self.matched_object_name = matched_object_name - self.matched_object_attribute = matched_object_attribute - self.highlight_snippet = highlight_snippet - self.matched_object_api = matched_object_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/nature_of_suit.py b/unicourt/model/nature_of_suit.py index 858b02d..6af7966 100644 --- a/unicourt/model/nature_of_suit.py +++ b/unicourt/model/nature_of_suit.py @@ -1,308 +1,111 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class NatureOfSuit(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class NatureOfSuit(BaseModel): """ + Nature Of Suit for a case. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=12, strict=True, max_length=12)]] = Field(default='NatureOfSuit', description="Name of the object") + source_text: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="Source nos code data from the court site.", alias="sourceText") + code: Optional[StrictInt] = Field(default=None, description="Nos Code from the source site which is extracted from the sourceText.") + name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Code Name from the source site which is extracted from the sourceText.") + section: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Section of a nos code extracted from the sourceText.") + __properties: ClassVar[List[str]] = ["object", "sourceText", "code", "name", "section"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 12, - 'min_length': 12, - }, - ('source_text',): { - 'max_length': 500, - }, - ('name',): { - 'max_length': 255, - }, - ('section',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NatureOfSuit from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'source_text': (str, none_type,), # noqa: E501 - 'code': (int,), # noqa: E501 - 'name': (str, none_type,), # noqa: E501 - 'section': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'source_text': 'sourceText', # noqa: E501 - 'code': 'code', # noqa: E501 - 'name': 'name', # noqa: E501 - 'section': 'section', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if source_text (nullable) is None + # and model_fields_set contains the field + if self.source_text is None and "source_text" in self.model_fields_set: + _dict['sourceText'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if section (nullable) is None + # and model_fields_set contains the field + if self.section is None and "section" in self.model_fields_set: + _dict['section'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, source_text, code, name, section, *args, **kwargs): # noqa: E501 - """NatureOfSuit - a model defined in OpenAPI - - Args: - source_text (str, none_type): Source nos code data from the court site. - code (int): Nos Code from the source site which is extracted from the sourceText. - name (str, none_type): Code Name from the source site which is extracted from the sourceText. - section (str, none_type): Section of a nos code extracted from the sourceText. - - Keyword Args: - object (str): Name of the object. defaults to "NatureOfSuit" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "NatureOfSuit") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.source_text = source_text - self.code = code - self.name = name - self.section = section - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, source_text, code, name, section, *args, **kwargs): # noqa: E501 - """NatureOfSuit - a model defined in OpenAPI - - Args: - source_text (str, none_type): Source nos code data from the court site. - code (int): Nos Code from the source site which is extracted from the sourceText. - name (str, none_type): Code Name from the source site which is extracted from the sourceText. - section (str, none_type): Section of a nos code extracted from the sourceText. - - Keyword Args: - object (str): Name of the object. defaults to "NatureOfSuit" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NatureOfSuit from a dict""" + if obj is None: + return None - object = kwargs.get('object', "NatureOfSuit") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NatureOfSuit', + "sourceText": obj.get("sourceText"), + "code": obj.get("code"), + "name": obj.get("name"), + "section": obj.get("section") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.source_text = source_text - self.code = code - self.name = name - self.section = section - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_attorney.py b/unicourt/model/norm_attorney.py index 8d8cc76..cb9354b 100644 --- a/unicourt/model/norm_attorney.py +++ b/unicourt/model/norm_attorney.py @@ -1,371 +1,139 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.attorney_analytics_api import AttorneyAnalyticsAPI - from unicourt.model.bar_record import BarRecord - from unicourt.model.case_analytics_api import CaseAnalyticsAPI - from unicourt.model.similar_norm_attorney import SimilarNormAttorney - globals()['AttorneyAnalyticsAPI'] = AttorneyAnalyticsAPI - globals()['BarRecord'] = BarRecord - globals()['CaseAnalyticsAPI'] = CaseAnalyticsAPI - globals()['SimilarNormAttorney'] = SimilarNormAttorney - - -class NormAttorney(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 12, - }, - ('norm_attorney_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 500, - }, - ('first_name',): { - 'max_length': 500, - }, - ('middle_name',): { - 'max_length': 500, - }, - ('last_name',): { - 'max_length': 500, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_attorney_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'first_name': (str,), # noqa: E501 - 'middle_name': (str, none_type,), # noqa: E501 - 'last_name': (str,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'case_analytics_api': (CaseAnalyticsAPI,), # noqa: E501 - 'has_associated_public_data': (bool,), # noqa: E501 - 'bar_record_array': ([BarRecord],), # noqa: E501 - 'attorney_analytics_api': (AttorneyAnalyticsAPI,), # noqa: E501 - 'similar_norm_attorney_array': ([SimilarNormAttorney],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_attorney_id': 'normAttorneyId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'first_name': 'firstName', # noqa: E501 - 'middle_name': 'middleName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_analytics_api': 'caseAnalyticsAPI', # noqa: E501 - 'has_associated_public_data': 'hasAssociatedPublicData', # noqa: E501 - 'bar_record_array': 'barRecordArray', # noqa: E501 - 'attorney_analytics_api': 'attorneyAnalyticsAPI', # noqa: E501 - 'similar_norm_attorney_array': 'similarNormAttorneyArray', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.attorney_analytics_api import AttorneyAnalyticsAPI +from unicourt.model.bar_record import BarRecord +from unicourt.model.case_analytics_api import CaseAnalyticsAPI +from unicourt.model.similar_norm_attorney import SimilarNormAttorney +from typing import Optional, Set +from typing_extensions import Self + +class NormAttorney(BaseModel): + """ + Norm Attorney + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=12)]] = 'NormAttorney' + norm_attorney_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normAttorneyId") + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + first_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="firstName") + middle_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="middleName") + last_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="lastName") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseSearchAPI") + case_analytics_api: Optional[CaseAnalyticsAPI] = Field(default=None, alias="caseAnalyticsAPI") + has_associated_public_data: Optional[StrictBool] = Field(default=None, alias="hasAssociatedPublicData") + bar_record_array: Optional[List[BarRecord]] = Field(default=None, alias="barRecordArray") + attorney_analytics_api: Optional[AttorneyAnalyticsAPI] = Field(default=None, alias="attorneyAnalyticsAPI") + similar_norm_attorney_array: Optional[List[SimilarNormAttorney]] = Field(default=None, alias="similarNormAttorneyArray") + __properties: ClassVar[List[str]] = ["object", "normAttorneyId", "name", "firstName", "middleName", "lastName", "caseSearchAPI", "caseAnalyticsAPI", "hasAssociatedPublicData", "barRecordArray", "attorneyAnalyticsAPI", "similarNormAttorneyArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_attorney_id, name, first_name, middle_name, last_name, case_search_api, case_analytics_api, has_associated_public_data, bar_record_array, attorney_analytics_api, similar_norm_attorney_array, *args, **kwargs): # noqa: E501 - """NormAttorney - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormAttorney from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - norm_attorney_id (str): - name (str): - first_name (str): - middle_name (str, none_type): - last_name (str): - case_search_api (str): - case_analytics_api (CaseAnalyticsAPI): - has_associated_public_data (bool): - bar_record_array ([BarRecord]): - attorney_analytics_api (AttorneyAnalyticsAPI): - similar_norm_attorney_array ([SimilarNormAttorney]): - - Keyword Args: - object (str): defaults to "NormAttorney" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "NormAttorney") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_attorney_id = norm_attorney_id - self.name = name - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.case_search_api = case_search_api - self.case_analytics_api = case_analytics_api - self.has_associated_public_data = has_associated_public_data - self.bar_record_array = bar_record_array - self.attorney_analytics_api = attorney_analytics_api - self.similar_norm_attorney_array = similar_norm_attorney_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_attorney_id, name, first_name, middle_name, last_name, case_search_api, case_analytics_api, has_associated_public_data, bar_record_array, attorney_analytics_api, similar_norm_attorney_array, *args, **kwargs): # noqa: E501 - """NormAttorney - a model defined in OpenAPI - - Args: - norm_attorney_id (str): - name (str): - first_name (str): - middle_name (str, none_type): - last_name (str): - case_search_api (str): - case_analytics_api (CaseAnalyticsAPI): - has_associated_public_data (bool): - bar_record_array ([BarRecord]): - attorney_analytics_api (AttorneyAnalyticsAPI): - similar_norm_attorney_array ([SimilarNormAttorney]): - - Keyword Args: - object (str): defaults to "NormAttorney" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_analytics_api + if self.case_analytics_api: + _dict['caseAnalyticsAPI'] = self.case_analytics_api.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in bar_record_array (list) + _items = [] + if self.bar_record_array: + for _item in self.bar_record_array: + if _item: + _items.append(_item.to_dict()) + _dict['barRecordArray'] = _items + # override the default output from pydantic by calling `to_dict()` of attorney_analytics_api + if self.attorney_analytics_api: + _dict['attorneyAnalyticsAPI'] = self.attorney_analytics_api.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in similar_norm_attorney_array (list) + _items = [] + if self.similar_norm_attorney_array: + for _item in self.similar_norm_attorney_array: + if _item: + _items.append(_item.to_dict()) + _dict['similarNormAttorneyArray'] = _items + # set to None if middle_name (nullable) is None + # and model_fields_set contains the field + if self.middle_name is None and "middle_name" in self.model_fields_set: + _dict['middleName'] = None + + return _dict - object = kwargs.get('object', "NormAttorney") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormAttorney from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormAttorney', + "normAttorneyId": obj.get("normAttorneyId"), + "name": obj.get("name"), + "firstName": obj.get("firstName"), + "middleName": obj.get("middleName"), + "lastName": obj.get("lastName"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseAnalyticsAPI": CaseAnalyticsAPI.from_dict(obj["caseAnalyticsAPI"]) if obj.get("caseAnalyticsAPI") is not None else None, + "hasAssociatedPublicData": obj.get("hasAssociatedPublicData"), + "barRecordArray": [BarRecord.from_dict(_item) for _item in obj["barRecordArray"]] if obj.get("barRecordArray") is not None else None, + "attorneyAnalyticsAPI": AttorneyAnalyticsAPI.from_dict(obj["attorneyAnalyticsAPI"]) if obj.get("attorneyAnalyticsAPI") is not None else None, + "similarNormAttorneyArray": [SimilarNormAttorney.from_dict(_item) for _item in obj["similarNormAttorneyArray"]] if obj.get("similarNormAttorneyArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_attorney_id = norm_attorney_id - self.name = name - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.case_search_api = case_search_api - self.case_analytics_api = case_analytics_api - self.has_associated_public_data = has_associated_public_data - self.bar_record_array = bar_record_array - self.attorney_analytics_api = attorney_analytics_api - self.similar_norm_attorney_array = similar_norm_attorney_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_attorney_search_response.py b/unicourt/model/norm_attorney_search_response.py index b3b01c9..ab1719c 100644 --- a/unicourt/model/norm_attorney_search_response.py +++ b/unicourt/model/norm_attorney_search_response.py @@ -1,353 +1,122 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.norm_attorney_search_result import NormAttorneySearchResult - globals()['NormAttorneySearchResult'] = NormAttorneySearchResult - - -class NormAttorneySearchResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 26, - 'min_length': 26, - }, - ('norm_attorney_search_result_array',): { - }, - ('q',): { - 'max_length': 2048, - 'min_length': 3, - }, - ('norm_attorney_search_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('next_page_api',): { - 'max_length': 2120, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2119, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_attorney_search_result_array': ([NormAttorneySearchResult],), # noqa: E501 - 'q': (str,), # noqa: E501 - 'norm_attorney_search_id': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_attorney_search_result_array': 'normAttorneySearchResultArray', # noqa: E501 - 'q': 'q', # noqa: E501 - 'norm_attorney_search_id': 'normAttorneySearchId', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.norm_attorney_search_result import NormAttorneySearchResult +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class NormAttorneySearchResponse(BaseModel): + """ + NormAttorneySearchResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=26, strict=True, max_length=26)]] = 'NormAttorneySearchResponse' + norm_attorney_search_result_array: Optional[List[NormAttorneySearchResult]] = Field(default=None, alias="normAttorneySearchResultArray") + q: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2048)]] = Field(default=None, description="Query been sent by client") + norm_attorney_search_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Query been sent by client", alias="normAttorneySearchId") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2120)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2119)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total pages for matches that were found in the index.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="The number of matches that were found in the index.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "normAttorneySearchResultArray", "q", "normAttorneySearchId", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_attorney_search_result_array, q, norm_attorney_search_id, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """NormAttorneySearchResponse - a model defined in OpenAPI - - Args: - norm_attorney_search_result_array ([NormAttorneySearchResult]): - q (str): Query been sent by client - norm_attorney_search_id (str): Query been sent by client - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): - total_pages (int): Total pages for matches that were found in the index. - total_count (int): The number of matches that were found in the index. - - Keyword Args: - object (str): defaults to "NormAttorneySearchResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "NormAttorneySearchResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormAttorneySearchResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_attorney_search_result_array = norm_attorney_search_result_array - self.q = q - self.norm_attorney_search_id = norm_attorney_search_id - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_attorney_search_result_array, q, norm_attorney_search_id, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """NormAttorneySearchResponse - a model defined in OpenAPI - - Args: - norm_attorney_search_result_array ([NormAttorneySearchResult]): - q (str): Query been sent by client - norm_attorney_search_id (str): Query been sent by client - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): - total_pages (int): Total pages for matches that were found in the index. - total_count (int): The number of matches that were found in the index. - - Keyword Args: - object (str): defaults to "NormAttorneySearchResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in norm_attorney_search_result_array (list) + _items = [] + if self.norm_attorney_search_result_array: + for _item in self.norm_attorney_search_result_array: + if _item: + _items.append(_item.to_dict()) + _dict['normAttorneySearchResultArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "NormAttorneySearchResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormAttorneySearchResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormAttorneySearchResponse', + "normAttorneySearchResultArray": [NormAttorneySearchResult.from_dict(_item) for _item in obj["normAttorneySearchResultArray"]] if obj.get("normAttorneySearchResultArray") is not None else None, + "q": obj.get("q"), + "normAttorneySearchId": obj.get("normAttorneySearchId"), + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_attorney_search_result_array = norm_attorney_search_result_array - self.q = q - self.norm_attorney_search_id = norm_attorney_search_id - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_attorney_search_result.py b/unicourt/model/norm_attorney_search_result.py index 8260272..44d157d 100644 --- a/unicourt/model/norm_attorney_search_result.py +++ b/unicourt/model/norm_attorney_search_result.py @@ -1,343 +1,111 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.matched_object import MatchedObject - globals()['MatchedObject'] = MatchedObject - - -class NormAttorneySearchResult(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 24, - 'min_length': 24, - }, - ('norm_attorney_id',): { - 'max_length': 18, - 'min_length': 17, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('norm_attorney_details_api',): { - 'max_length': 255, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_attorney_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'first_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date': (datetime,), # noqa: E501 - 'has_associated_public_data': (bool,), # noqa: E501 - 'norm_attorney_details_api': (str,), # noqa: E501 - 'matched_object_array': ([MatchedObject],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_attorney_id': 'normAttorneyId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'has_associated_public_data': 'hasAssociatedPublicData', # noqa: E501 - 'norm_attorney_details_api': 'normAttorneyDetailsAPI', # noqa: E501 - 'matched_object_array': 'matchedObjectArray', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.matched_object import MatchedObject +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class NormAttorneySearchResult(BaseModel): + """ + NormAttorneySearchResult + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=24, strict=True, max_length=24)]] = 'NormAttorneySearchResult' + norm_attorney_id: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=18)]] = Field(default=None, alias="normAttorneyId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + first_fetch_date: Optional[datetime] = Field(default=None, alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, alias="lastFetchDate") + has_associated_public_data: Optional[StrictBool] = Field(default=None, alias="hasAssociatedPublicData") + norm_attorney_details_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="normAttorneyDetailsAPI") + matched_object_array: Optional[List[MatchedObject]] = Field(default=None, alias="matchedObjectArray") + __properties: ClassVar[List[str]] = ["object", "normAttorneyId", "name", "firstFetchDate", "lastFetchDate", "hasAssociatedPublicData", "normAttorneyDetailsAPI", "matchedObjectArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_attorney_id, name, first_fetch_date, last_fetch_date, has_associated_public_data, norm_attorney_details_api, matched_object_array, *args, **kwargs): # noqa: E501 - """NormAttorneySearchResult - a model defined in OpenAPI - - Args: - norm_attorney_id (str): - name (str): - first_fetch_date (datetime): - last_fetch_date (datetime): - has_associated_public_data (bool): - norm_attorney_details_api (str): - matched_object_array ([MatchedObject]): - - Keyword Args: - object (str): defaults to "NormAttorneySearchResult" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "NormAttorneySearchResult") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormAttorneySearchResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_attorney_id = norm_attorney_id - self.name = name - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.has_associated_public_data = has_associated_public_data - self.norm_attorney_details_api = norm_attorney_details_api - self.matched_object_array = matched_object_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_attorney_id, name, first_fetch_date, last_fetch_date, has_associated_public_data, norm_attorney_details_api, matched_object_array, *args, **kwargs): # noqa: E501 - """NormAttorneySearchResult - a model defined in OpenAPI - - Args: - norm_attorney_id (str): - name (str): - first_fetch_date (datetime): - last_fetch_date (datetime): - has_associated_public_data (bool): - norm_attorney_details_api (str): - matched_object_array ([MatchedObject]): - - Keyword Args: - object (str): defaults to "NormAttorneySearchResult" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in matched_object_array (list) + _items = [] + if self.matched_object_array: + for _item in self.matched_object_array: + if _item: + _items.append(_item.to_dict()) + _dict['matchedObjectArray'] = _items + return _dict - object = kwargs.get('object', "NormAttorneySearchResult") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormAttorneySearchResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormAttorneySearchResult', + "normAttorneyId": obj.get("normAttorneyId"), + "name": obj.get("name"), + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate"), + "hasAssociatedPublicData": obj.get("hasAssociatedPublicData"), + "normAttorneyDetailsAPI": obj.get("normAttorneyDetailsAPI"), + "matchedObjectArray": [MatchedObject.from_dict(_item) for _item in obj["matchedObjectArray"]] if obj.get("matchedObjectArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_attorney_id = norm_attorney_id - self.name = name - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.has_associated_public_data = has_associated_public_data - self.norm_attorney_details_api = norm_attorney_details_api - self.matched_object_array = matched_object_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_corporate_group.py b/unicourt/model/norm_corporate_group.py index 863d477..74a958a 100644 --- a/unicourt/model/norm_corporate_group.py +++ b/unicourt/model/norm_corporate_group.py @@ -1,293 +1,102 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class NormCorporateGroup(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 18, - }, - ('norm_corporate_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('norm_corporate_group_name',): { - 'max_length': 500, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'norm_corporate_group_id': (str, none_type,), # noqa: E501 - 'norm_corporate_group_name': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class NormCorporateGroup(BaseModel): + """ + NormCorporateGroup + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=18)]] = 'NormCorporateGroup' + norm_corporate_group_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normCorporateGroupId") + norm_corporate_group_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="normCorporateGroupName") + __properties: ClassVar[List[str]] = ["object", "normCorporateGroupId", "normCorporateGroupName"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_corporate_group_id': 'normCorporateGroupId', # noqa: E501 - 'norm_corporate_group_name': 'normCorporateGroupName', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_corporate_group_id, norm_corporate_group_name, *args, **kwargs): # noqa: E501 - """NormCorporateGroup - a model defined in OpenAPI - - Args: - norm_corporate_group_id (str, none_type): - norm_corporate_group_name (str, none_type): - - Keyword Args: - object (str): defaults to "NormCorporateGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "NormCorporateGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormCorporateGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_corporate_group_id = norm_corporate_group_id - self.norm_corporate_group_name = norm_corporate_group_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_corporate_group_id, norm_corporate_group_name, *args, **kwargs): # noqa: E501 - """NormCorporateGroup - a model defined in OpenAPI - - Args: - norm_corporate_group_id (str, none_type): - norm_corporate_group_name (str, none_type): - - Keyword Args: - object (str): defaults to "NormCorporateGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if norm_corporate_group_id (nullable) is None + # and model_fields_set contains the field + if self.norm_corporate_group_id is None and "norm_corporate_group_id" in self.model_fields_set: + _dict['normCorporateGroupId'] = None + + # set to None if norm_corporate_group_name (nullable) is None + # and model_fields_set contains the field + if self.norm_corporate_group_name is None and "norm_corporate_group_name" in self.model_fields_set: + _dict['normCorporateGroupName'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormCorporateGroup from a dict""" + if obj is None: + return None - object = kwargs.get('object', "NormCorporateGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormCorporateGroup', + "normCorporateGroupId": obj.get("normCorporateGroupId"), + "normCorporateGroupName": obj.get("normCorporateGroupName") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_corporate_group_id = norm_corporate_group_id - self.norm_corporate_group_name = norm_corporate_group_name - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_judge.py b/unicourt/model/norm_judge.py index 022e571..952fc3d 100644 --- a/unicourt/model/norm_judge.py +++ b/unicourt/model/norm_judge.py @@ -1,363 +1,129 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_analytics_api import CaseAnalyticsAPI - from unicourt.model.judge_analytics_api import JudgeAnalyticsAPI - from unicourt.model.norm_judge_public_data import NormJudgePublicData - globals()['CaseAnalyticsAPI'] = CaseAnalyticsAPI - globals()['JudgeAnalyticsAPI'] = JudgeAnalyticsAPI - globals()['NormJudgePublicData'] = NormJudgePublicData - - -class NormJudge(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 9, - }, - ('norm_judge_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 500, - }, - ('first_name',): { - 'max_length': 500, - }, - ('middle_name',): { - 'max_length': 500, - }, - ('last_name',): { - 'max_length': 500, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_judge_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'first_name': (str,), # noqa: E501 - 'middle_name': (str, none_type,), # noqa: E501 - 'last_name': (str,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'case_analytics_api': (CaseAnalyticsAPI,), # noqa: E501 - 'has_associated_public_data': (bool,), # noqa: E501 - 'judicial_data_array': ([NormJudgePublicData],), # noqa: E501 - 'judge_analytics_api': (JudgeAnalyticsAPI,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_judge_id': 'normJudgeId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'first_name': 'firstName', # noqa: E501 - 'middle_name': 'middleName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_analytics_api': 'caseAnalyticsAPI', # noqa: E501 - 'has_associated_public_data': 'hasAssociatedPublicData', # noqa: E501 - 'judicial_data_array': 'judicialDataArray', # noqa: E501 - 'judge_analytics_api': 'judgeAnalyticsAPI', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_analytics_api import CaseAnalyticsAPI +from unicourt.model.judge_analytics_api import JudgeAnalyticsAPI +from unicourt.model.norm_judge_public_data import NormJudgePublicData +from typing import Optional, Set +from typing_extensions import Self + +class NormJudge(BaseModel): + """ + Norm Judge + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=9)]] = 'NormJudge' + norm_judge_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normJudgeId") + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + first_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="firstName") + middle_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="middleName") + last_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="lastName") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseSearchAPI") + case_analytics_api: Optional[CaseAnalyticsAPI] = Field(default=None, alias="caseAnalyticsAPI") + has_associated_public_data: Optional[StrictBool] = Field(default=None, alias="hasAssociatedPublicData") + judicial_data_array: Optional[List[NormJudgePublicData]] = Field(default=None, alias="judicialDataArray") + judge_analytics_api: Optional[JudgeAnalyticsAPI] = Field(default=None, alias="judgeAnalyticsAPI") + __properties: ClassVar[List[str]] = ["object", "normJudgeId", "name", "firstName", "middleName", "lastName", "caseSearchAPI", "caseAnalyticsAPI", "hasAssociatedPublicData", "judicialDataArray", "judgeAnalyticsAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_judge_id, name, first_name, middle_name, last_name, case_search_api, case_analytics_api, has_associated_public_data, judicial_data_array, judge_analytics_api, *args, **kwargs): # noqa: E501 - """NormJudge - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormJudge from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - norm_judge_id (str): - name (str): - first_name (str): - middle_name (str, none_type): - last_name (str): - case_search_api (str): - case_analytics_api (CaseAnalyticsAPI): - has_associated_public_data (bool): - judicial_data_array ([NormJudgePublicData]): - judge_analytics_api (JudgeAnalyticsAPI): - - Keyword Args: - object (str): defaults to "NormJudge" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "NormJudge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_judge_id = norm_judge_id - self.name = name - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.case_search_api = case_search_api - self.case_analytics_api = case_analytics_api - self.has_associated_public_data = has_associated_public_data - self.judicial_data_array = judicial_data_array - self.judge_analytics_api = judge_analytics_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_judge_id, name, first_name, middle_name, last_name, case_search_api, case_analytics_api, has_associated_public_data, judicial_data_array, judge_analytics_api, *args, **kwargs): # noqa: E501 - """NormJudge - a model defined in OpenAPI - - Args: - norm_judge_id (str): - name (str): - first_name (str): - middle_name (str, none_type): - last_name (str): - case_search_api (str): - case_analytics_api (CaseAnalyticsAPI): - has_associated_public_data (bool): - judicial_data_array ([NormJudgePublicData]): - judge_analytics_api (JudgeAnalyticsAPI): - - Keyword Args: - object (str): defaults to "NormJudge" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_analytics_api + if self.case_analytics_api: + _dict['caseAnalyticsAPI'] = self.case_analytics_api.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in judicial_data_array (list) + _items = [] + if self.judicial_data_array: + for _item in self.judicial_data_array: + if _item: + _items.append(_item.to_dict()) + _dict['judicialDataArray'] = _items + # override the default output from pydantic by calling `to_dict()` of judge_analytics_api + if self.judge_analytics_api: + _dict['judgeAnalyticsAPI'] = self.judge_analytics_api.to_dict() + # set to None if middle_name (nullable) is None + # and model_fields_set contains the field + if self.middle_name is None and "middle_name" in self.model_fields_set: + _dict['middleName'] = None + + return _dict - object = kwargs.get('object', "NormJudge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormJudge from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormJudge', + "normJudgeId": obj.get("normJudgeId"), + "name": obj.get("name"), + "firstName": obj.get("firstName"), + "middleName": obj.get("middleName"), + "lastName": obj.get("lastName"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseAnalyticsAPI": CaseAnalyticsAPI.from_dict(obj["caseAnalyticsAPI"]) if obj.get("caseAnalyticsAPI") is not None else None, + "hasAssociatedPublicData": obj.get("hasAssociatedPublicData"), + "judicialDataArray": [NormJudgePublicData.from_dict(_item) for _item in obj["judicialDataArray"]] if obj.get("judicialDataArray") is not None else None, + "judgeAnalyticsAPI": JudgeAnalyticsAPI.from_dict(obj["judgeAnalyticsAPI"]) if obj.get("judgeAnalyticsAPI") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_judge_id = norm_judge_id - self.name = name - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.case_search_api = case_search_api - self.case_analytics_api = case_analytics_api - self.has_associated_public_data = has_associated_public_data - self.judicial_data_array = judicial_data_array - self.judge_analytics_api = judge_analytics_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_judge_public_data.py b/unicourt/model/norm_judge_public_data.py index c8f98be..ff16741 100644 --- a/unicourt/model/norm_judge_public_data.py +++ b/unicourt/model/norm_judge_public_data.py @@ -1,384 +1,175 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.contact import Contact - from unicourt.model.norm_judge_public_data_aba_ratings import NormJudgePublicDataAbaRatings - from unicourt.model.norm_judge_public_data_bio import NormJudgePublicDataBio - from unicourt.model.norm_judge_public_data_education_array_inner import NormJudgePublicDataEducationArrayInner - from unicourt.model.norm_judge_public_data_judicial_source import NormJudgePublicDataJudicialSource - from unicourt.model.norm_judge_public_data_name_history_array_inner import NormJudgePublicDataNameHistoryArrayInner - from unicourt.model.service_history import ServiceHistory - globals()['Contact'] = Contact - globals()['NormJudgePublicDataAbaRatings'] = NormJudgePublicDataAbaRatings - globals()['NormJudgePublicDataBio'] = NormJudgePublicDataBio - globals()['NormJudgePublicDataEducationArrayInner'] = NormJudgePublicDataEducationArrayInner - globals()['NormJudgePublicDataJudicialSource'] = NormJudgePublicDataJudicialSource - globals()['NormJudgePublicDataNameHistoryArrayInner'] = NormJudgePublicDataNameHistoryArrayInner - globals()['ServiceHistory'] = ServiceHistory - - -class NormJudgePublicData(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 19, - }, - ('judicial_status',): { - 'max_length': 50, - }, - ('education_array',): { - }, - ('first_fetch_date',): { - 'max_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - }, - ('last_fetch_date_with_updates',): { - 'max_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'judicial_status': (str, none_type,), # noqa: E501 - 'judicial_source': (NormJudgePublicDataJudicialSource,), # noqa: E501 - 'aba_ratings': (NormJudgePublicDataAbaRatings,), # noqa: E501 - 'alias_array': ([str],), # noqa: E501 - 'bio': (NormJudgePublicDataBio,), # noqa: E501 - 'contact': (Contact,), # noqa: E501 - 'education_array': ([NormJudgePublicDataEducationArrayInner],), # noqa: E501 - 'professional_career_array': ([str],), # noqa: E501 - 'service_history_array': ([ServiceHistory],), # noqa: E501 - 'name_history_array': ([NormJudgePublicDataNameHistoryArrayInner],), # noqa: E501 - 'first_fetch_date': (datetime, none_type,), # noqa: E501 - 'last_fetch_date': (datetime, none_type,), # noqa: E501 - 'last_fetch_date_with_updates': (datetime, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'judicial_status': 'judicialStatus', # noqa: E501 - 'judicial_source': 'judicialSource', # noqa: E501 - 'aba_ratings': 'abaRatings', # noqa: E501 - 'alias_array': 'aliasArray', # noqa: E501 - 'bio': 'bio', # noqa: E501 - 'contact': 'contact', # noqa: E501 - 'education_array': 'educationArray', # noqa: E501 - 'professional_career_array': 'professionalCareerArray', # noqa: E501 - 'service_history_array': 'serviceHistoryArray', # noqa: E501 - 'name_history_array': 'nameHistoryArray', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'last_fetch_date_with_updates': 'lastFetchDateWithUpdates', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.contact import Contact +from unicourt.model.norm_judge_public_data_aba_ratings import NormJudgePublicDataAbaRatings +from unicourt.model.norm_judge_public_data_bio import NormJudgePublicDataBio +from unicourt.model.norm_judge_public_data_education_array_inner import NormJudgePublicDataEducationArrayInner +from unicourt.model.norm_judge_public_data_judicial_source import NormJudgePublicDataJudicialSource +from unicourt.model.norm_judge_public_data_name_history_array_inner import NormJudgePublicDataNameHistoryArrayInner +from unicourt.model.service_history import ServiceHistory +from typing import Optional, Set +from typing_extensions import Self + +class NormJudgePublicData(BaseModel): + """ + This contains the Judge Public details that is obtained from various sources. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=19)]] = 'NormJudgePublicData' + judicial_status: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="The judicial status of the Judge", alias="judicialStatus") + judicial_source: Optional[NormJudgePublicDataJudicialSource] = Field(default=None, alias="judicialSource") + aba_ratings: Optional[NormJudgePublicDataAbaRatings] = Field(default=None, alias="abaRatings") + alias_array: Optional[List[Annotated[str, Field(strict=True, max_length=250)]]] = Field(default=None, description="Other Names of the Judge.", alias="aliasArray") + bio: Optional[NormJudgePublicDataBio] = None + contact: Optional[Contact] = None + education_array: Optional[List[NormJudgePublicDataEducationArrayInner]] = Field(default=None, description="The Education History of the judge.", alias="educationArray") + professional_career_array: Optional[List[Annotated[str, Field(strict=True, max_length=2000)]]] = Field(default=None, description="The non-judicial career history of the judge.", alias="professionalCareerArray") + service_history_array: Optional[List[ServiceHistory]] = Field(default=None, description="Judicial History of the Judge.", alias="serviceHistoryArray") + name_history_array: Optional[List[NormJudgePublicDataNameHistoryArrayInner]] = Field(default=None, description="Name changes of the Judge. Change in the official name. Other names go to Alias array.", alias="nameHistoryArray") + first_fetch_date: Optional[datetime] = Field(default=None, alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, alias="lastFetchDate") + last_fetch_date_with_updates: Optional[datetime] = Field(default=None, description="Last Fetch Date of the Judge Update.", alias="lastFetchDateWithUpdates") + __properties: ClassVar[List[str]] = ["object", "judicialStatus", "judicialSource", "abaRatings", "aliasArray", "bio", "contact", "educationArray", "professionalCareerArray", "serviceHistoryArray", "nameHistoryArray", "firstFetchDate", "lastFetchDate", "lastFetchDateWithUpdates"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, judicial_status, judicial_source, aba_ratings, alias_array, bio, contact, education_array, professional_career_array, service_history_array, name_history_array, first_fetch_date, last_fetch_date, last_fetch_date_with_updates, *args, **kwargs): # noqa: E501 - """NormJudgePublicData - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormJudgePublicData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - judicial_status (str, none_type): The judicial status of the Judge - judicial_source (NormJudgePublicDataJudicialSource): - aba_ratings (NormJudgePublicDataAbaRatings): - alias_array ([str]): Other Names of the Judge. - bio (NormJudgePublicDataBio): - contact (Contact): - education_array ([NormJudgePublicDataEducationArrayInner]): The Education History of the judge. - professional_career_array ([str]): The non-judicial career history of the judge. - service_history_array ([ServiceHistory]): Judicial History of the Judge. - name_history_array ([NormJudgePublicDataNameHistoryArrayInner]): Name changes of the Judge. Change in the official name. Other names go to Alias array. - first_fetch_date (datetime, none_type): - last_fetch_date (datetime, none_type): - last_fetch_date_with_updates (datetime, none_type): Last Fetch Date of the Judge Update. - - Keyword Args: - object (str): defaults to "NormJudgePublicData" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "NormJudgePublicData") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.judicial_status = judicial_status - self.judicial_source = judicial_source - self.aba_ratings = aba_ratings - self.alias_array = alias_array - self.bio = bio - self.contact = contact - self.education_array = education_array - self.professional_career_array = professional_career_array - self.service_history_array = service_history_array - self.name_history_array = name_history_array - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.last_fetch_date_with_updates = last_fetch_date_with_updates - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, judicial_status, judicial_source, aba_ratings, alias_array, bio, contact, education_array, professional_career_array, service_history_array, name_history_array, first_fetch_date, last_fetch_date, last_fetch_date_with_updates, *args, **kwargs): # noqa: E501 - """NormJudgePublicData - a model defined in OpenAPI - - Args: - judicial_status (str, none_type): The judicial status of the Judge - judicial_source (NormJudgePublicDataJudicialSource): - aba_ratings (NormJudgePublicDataAbaRatings): - alias_array ([str]): Other Names of the Judge. - bio (NormJudgePublicDataBio): - contact (Contact): - education_array ([NormJudgePublicDataEducationArrayInner]): The Education History of the judge. - professional_career_array ([str]): The non-judicial career history of the judge. - service_history_array ([ServiceHistory]): Judicial History of the Judge. - name_history_array ([NormJudgePublicDataNameHistoryArrayInner]): Name changes of the Judge. Change in the official name. Other names go to Alias array. - first_fetch_date (datetime, none_type): - last_fetch_date (datetime, none_type): - last_fetch_date_with_updates (datetime, none_type): Last Fetch Date of the Judge Update. - - Keyword Args: - object (str): defaults to "NormJudgePublicData" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of judicial_source + if self.judicial_source: + _dict['judicialSource'] = self.judicial_source.to_dict() + # override the default output from pydantic by calling `to_dict()` of aba_ratings + if self.aba_ratings: + _dict['abaRatings'] = self.aba_ratings.to_dict() + # override the default output from pydantic by calling `to_dict()` of bio + if self.bio: + _dict['bio'] = self.bio.to_dict() + # override the default output from pydantic by calling `to_dict()` of contact + if self.contact: + _dict['contact'] = self.contact.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in education_array (list) + _items = [] + if self.education_array: + for _item in self.education_array: + if _item: + _items.append(_item.to_dict()) + _dict['educationArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in service_history_array (list) + _items = [] + if self.service_history_array: + for _item in self.service_history_array: + if _item: + _items.append(_item.to_dict()) + _dict['serviceHistoryArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in name_history_array (list) + _items = [] + if self.name_history_array: + for _item in self.name_history_array: + if _item: + _items.append(_item.to_dict()) + _dict['nameHistoryArray'] = _items + # set to None if judicial_status (nullable) is None + # and model_fields_set contains the field + if self.judicial_status is None and "judicial_status" in self.model_fields_set: + _dict['judicialStatus'] = None + + # set to None if first_fetch_date (nullable) is None + # and model_fields_set contains the field + if self.first_fetch_date is None and "first_fetch_date" in self.model_fields_set: + _dict['firstFetchDate'] = None + + # set to None if last_fetch_date (nullable) is None + # and model_fields_set contains the field + if self.last_fetch_date is None and "last_fetch_date" in self.model_fields_set: + _dict['lastFetchDate'] = None + + # set to None if last_fetch_date_with_updates (nullable) is None + # and model_fields_set contains the field + if self.last_fetch_date_with_updates is None and "last_fetch_date_with_updates" in self.model_fields_set: + _dict['lastFetchDateWithUpdates'] = None + + return _dict - object = kwargs.get('object', "NormJudgePublicData") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormJudgePublicData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormJudgePublicData', + "judicialStatus": obj.get("judicialStatus"), + "judicialSource": NormJudgePublicDataJudicialSource.from_dict(obj["judicialSource"]) if obj.get("judicialSource") is not None else None, + "abaRatings": NormJudgePublicDataAbaRatings.from_dict(obj["abaRatings"]) if obj.get("abaRatings") is not None else None, + "aliasArray": obj.get("aliasArray"), + "bio": NormJudgePublicDataBio.from_dict(obj["bio"]) if obj.get("bio") is not None else None, + "contact": Contact.from_dict(obj["contact"]) if obj.get("contact") is not None else None, + "educationArray": [NormJudgePublicDataEducationArrayInner.from_dict(_item) for _item in obj["educationArray"]] if obj.get("educationArray") is not None else None, + "professionalCareerArray": obj.get("professionalCareerArray"), + "serviceHistoryArray": [ServiceHistory.from_dict(_item) for _item in obj["serviceHistoryArray"]] if obj.get("serviceHistoryArray") is not None else None, + "nameHistoryArray": [NormJudgePublicDataNameHistoryArrayInner.from_dict(_item) for _item in obj["nameHistoryArray"]] if obj.get("nameHistoryArray") is not None else None, + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate"), + "lastFetchDateWithUpdates": obj.get("lastFetchDateWithUpdates") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.judicial_status = judicial_status - self.judicial_source = judicial_source - self.aba_ratings = aba_ratings - self.alias_array = alias_array - self.bio = bio - self.contact = contact - self.education_array = education_array - self.professional_career_array = professional_career_array - self.service_history_array = service_history_array - self.name_history_array = name_history_array - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.last_fetch_date_with_updates = last_fetch_date_with_updates - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_judge_public_data_aba_ratings.py b/unicourt/model/norm_judge_public_data_aba_ratings.py index 029b37c..fe9579a 100644 --- a/unicourt/model/norm_judge_public_data_aba_ratings.py +++ b/unicourt/model/norm_judge_public_data_aba_ratings.py @@ -1,278 +1,100 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class NormJudgePublicDataAbaRatings(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('rating',): { - 'max_length': 50, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'rating': (str, none_type,), # noqa: E501 - 'year': (int, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class NormJudgePublicDataAbaRatings(BaseModel): + """ + American Bar Association (ABA) Rating of the Judge. + """ # noqa: E501 + rating: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="rating") + year: Optional[StrictInt] = Field(default=None, description="Year when Rating was recieved.") + __properties: ClassVar[List[str]] = ["rating", "year"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'rating': 'rating', # noqa: E501 - 'year': 'year', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, rating, year, *args, **kwargs): # noqa: E501 - """NormJudgePublicDataAbaRatings - a model defined in OpenAPI - - Args: - rating (str, none_type): rating - year (int, none_type): Year when Rating was recieved. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormJudgePublicDataAbaRatings from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.rating = rating - self.year = year - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, rating, year, *args, **kwargs): # noqa: E501 - """NormJudgePublicDataAbaRatings - a model defined in OpenAPI - - Args: - rating (str, none_type): rating - year (int, none_type): Year when Rating was recieved. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if rating (nullable) is None + # and model_fields_set contains the field + if self.rating is None and "rating" in self.model_fields_set: + _dict['rating'] = None + + # set to None if year (nullable) is None + # and model_fields_set contains the field + if self.year is None and "year" in self.model_fields_set: + _dict['year'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormJudgePublicDataAbaRatings from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "rating": obj.get("rating"), + "year": obj.get("year") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.rating = rating - self.year = year - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_judge_public_data_bio.py b/unicourt/model/norm_judge_public_data_bio.py index 228f53b..b268f2b 100644 --- a/unicourt/model/norm_judge_public_data_bio.py +++ b/unicourt/model/norm_judge_public_data_bio.py @@ -1,335 +1,143 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class NormJudgePublicDataBio(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('ethnicity',): { - 'max_length': 50, - }, - ('birth_city',): { - 'max_length': 50, - }, - ('birth_date',): { - 'max_length': 25, - }, - ('birth_state',): { - 'max_length': 50, - }, - ('death_city',): { - 'max_length': 50, - }, - ('death_date',): { - 'max_length': 25, - }, - ('death_state',): { - 'max_length': 50, - }, - ('political_affiliation',): { - 'max_length': 50, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'ethnicity': (str, none_type,), # noqa: E501 - 'birth_city': (str, none_type,), # noqa: E501 - 'birth_date': (datetime, none_type,), # noqa: E501 - 'birth_state': (str, none_type,), # noqa: E501 - 'death_city': (str, none_type,), # noqa: E501 - 'death_date': (datetime, none_type,), # noqa: E501 - 'death_state': (str, none_type,), # noqa: E501 - 'political_affiliation': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'ethnicity': 'ethnicity', # noqa: E501 - 'birth_city': 'birthCity', # noqa: E501 - 'birth_date': 'birthDate', # noqa: E501 - 'birth_state': 'birthState', # noqa: E501 - 'death_city': 'deathCity', # noqa: E501 - 'death_date': 'deathDate', # noqa: E501 - 'death_state': 'deathState', # noqa: E501 - 'political_affiliation': 'politicalAffiliation', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class NormJudgePublicDataBio(BaseModel): + """ + NormJudgePublicDataBio + """ # noqa: E501 + ethnicity: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="Ethnic Group of the Judge.") + birth_city: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="The Birth City of the Judge.", alias="birthCity") + birth_date: Optional[datetime] = Field(default=None, description="The Date of Birth of the Judge.", alias="birthDate") + birth_state: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="The Birth State of the Judge.", alias="birthState") + death_city: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="The Death City of the Judge.", alias="deathCity") + death_date: Optional[datetime] = Field(default=None, description="The Date of the Death of the Judge.", alias="deathDate") + death_state: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="The Death State of the Judge.", alias="deathState") + political_affiliation: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="The Political Affiliation of the Judge.", alias="politicalAffiliation") + __properties: ClassVar[List[str]] = ["ethnicity", "birthCity", "birthDate", "birthState", "deathCity", "deathDate", "deathState", "politicalAffiliation"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, ethnicity, birth_city, birth_date, birth_state, death_city, death_date, death_state, political_affiliation, *args, **kwargs): # noqa: E501 - """NormJudgePublicDataBio - a model defined in OpenAPI - - Args: - ethnicity (str, none_type): Ethnic Group of the Judge. - birth_city (str, none_type): The Birth City of the Judge. - birth_date (datetime, none_type): The Date of Birth of the Judge. - birth_state (str, none_type): The Birth State of the Judge. - death_city (str, none_type): The Death City of the Judge. - death_date (datetime, none_type): The Date of the Death of the Judge. - death_state (str, none_type): The Death State of the Judge. - political_affiliation (str, none_type): The Political Affiliation of the Judge. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormJudgePublicDataBio from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.ethnicity = ethnicity - self.birth_city = birth_city - self.birth_date = birth_date - self.birth_state = birth_state - self.death_city = death_city - self.death_date = death_date - self.death_state = death_state - self.political_affiliation = political_affiliation - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, ethnicity, birth_city, birth_date, birth_state, death_city, death_date, death_state, political_affiliation, *args, **kwargs): # noqa: E501 - """NormJudgePublicDataBio - a model defined in OpenAPI - - Args: - ethnicity (str, none_type): Ethnic Group of the Judge. - birth_city (str, none_type): The Birth City of the Judge. - birth_date (datetime, none_type): The Date of Birth of the Judge. - birth_state (str, none_type): The Birth State of the Judge. - death_city (str, none_type): The Death City of the Judge. - death_date (datetime, none_type): The Date of the Death of the Judge. - death_state (str, none_type): The Death State of the Judge. - political_affiliation (str, none_type): The Political Affiliation of the Judge. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if ethnicity (nullable) is None + # and model_fields_set contains the field + if self.ethnicity is None and "ethnicity" in self.model_fields_set: + _dict['ethnicity'] = None + + # set to None if birth_city (nullable) is None + # and model_fields_set contains the field + if self.birth_city is None and "birth_city" in self.model_fields_set: + _dict['birthCity'] = None + + # set to None if birth_date (nullable) is None + # and model_fields_set contains the field + if self.birth_date is None and "birth_date" in self.model_fields_set: + _dict['birthDate'] = None + + # set to None if birth_state (nullable) is None + # and model_fields_set contains the field + if self.birth_state is None and "birth_state" in self.model_fields_set: + _dict['birthState'] = None + + # set to None if death_city (nullable) is None + # and model_fields_set contains the field + if self.death_city is None and "death_city" in self.model_fields_set: + _dict['deathCity'] = None + + # set to None if death_date (nullable) is None + # and model_fields_set contains the field + if self.death_date is None and "death_date" in self.model_fields_set: + _dict['deathDate'] = None + + # set to None if death_state (nullable) is None + # and model_fields_set contains the field + if self.death_state is None and "death_state" in self.model_fields_set: + _dict['deathState'] = None + + # set to None if political_affiliation (nullable) is None + # and model_fields_set contains the field + if self.political_affiliation is None and "political_affiliation" in self.model_fields_set: + _dict['politicalAffiliation'] = None + + return _dict - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormJudgePublicDataBio from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ethnicity": obj.get("ethnicity"), + "birthCity": obj.get("birthCity"), + "birthDate": obj.get("birthDate"), + "birthState": obj.get("birthState"), + "deathCity": obj.get("deathCity"), + "deathDate": obj.get("deathDate"), + "deathState": obj.get("deathState"), + "politicalAffiliation": obj.get("politicalAffiliation") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.ethnicity = ethnicity - self.birth_city = birth_city - self.birth_date = birth_date - self.birth_state = birth_state - self.death_city = death_city - self.death_date = death_date - self.death_state = death_state - self.political_affiliation = political_affiliation - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_judge_public_data_education_array_inner.py b/unicourt/model/norm_judge_public_data_education_array_inner.py index 5f4cdf7..df276f0 100644 --- a/unicourt/model/norm_judge_public_data_education_array_inner.py +++ b/unicourt/model/norm_judge_public_data_education_array_inner.py @@ -1,287 +1,107 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class NormJudgePublicDataEducationArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('degree',): { - 'max_length': 250, - }, - ('school',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'degree': (str, none_type,), # noqa: E501 - 'year': (int, none_type,), # noqa: E501 - 'school': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class NormJudgePublicDataEducationArrayInner(BaseModel): + """ + NormJudgePublicDataEducationArrayInner + """ # noqa: E501 + degree: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="The Degree Awarded to the Judge") + year: Optional[StrictInt] = Field(default=None, description="The year when the degree was awarded.") + school: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="The University which awarded the degree to the Judge.") + __properties: ClassVar[List[str]] = ["degree", "year", "school"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'degree': 'degree', # noqa: E501 - 'year': 'year', # noqa: E501 - 'school': 'school', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, degree, year, school, *args, **kwargs): # noqa: E501 - """NormJudgePublicDataEducationArrayInner - a model defined in OpenAPI - - Args: - degree (str, none_type): The Degree Awarded to the Judge - year (int, none_type): The year when the degree was awarded. - school (str, none_type): The University which awarded the degree to the Judge. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormJudgePublicDataEducationArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self = super(OpenApiModel, cls).__new__(cls) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.degree = degree - self.year = year - self.school = school - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, degree, year, school, *args, **kwargs): # noqa: E501 - """NormJudgePublicDataEducationArrayInner - a model defined in OpenAPI - - Args: - degree (str, none_type): The Degree Awarded to the Judge - year (int, none_type): The year when the degree was awarded. - school (str, none_type): The University which awarded the degree to the Judge. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if degree (nullable) is None + # and model_fields_set contains the field + if self.degree is None and "degree" in self.model_fields_set: + _dict['degree'] = None + + # set to None if year (nullable) is None + # and model_fields_set contains the field + if self.year is None and "year" in self.model_fields_set: + _dict['year'] = None + + # set to None if school (nullable) is None + # and model_fields_set contains the field + if self.school is None and "school" in self.model_fields_set: + _dict['school'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormJudgePublicDataEducationArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "degree": obj.get("degree"), + "year": obj.get("year"), + "school": obj.get("school") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.degree = degree - self.year = year - self.school = school - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_judge_public_data_judicial_source.py b/unicourt/model/norm_judge_public_data_judicial_source.py index b1ffa4e..34ef1e1 100644 --- a/unicourt/model/norm_judge_public_data_judicial_source.py +++ b/unicourt/model/norm_judge_public_data_judicial_source.py @@ -1,294 +1,107 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class NormJudgePublicDataJudicialSource(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class NormJudgePublicDataJudicialSource(BaseModel): """ + The judicial source of the Judge + """ # noqa: E501 + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="Name of the Judicial Data Source") + type: Optional[Annotated[str, Field(strict=True, max_length=7)]] = Field(default=None, description="Type of acquisition of the data source") + url: Optional[Annotated[str, Field(strict=True, max_length=150)]] = Field(default=None, description="URL of the data source, if type is Website") + __properties: ClassVar[List[str]] = ["name", "type", "url"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Website', 'Other']): + raise ValueError("must be one of enum values ('Website', 'Other')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('type',): { - 'WEBSITE': "Website", - 'OTHER': "Other", - }, - } - - validations = { - ('name',): { - 'max_length': 500, - }, - ('type',): { - 'max_length': 7, - }, - ('url',): { - 'max_length': 150, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormJudgePublicDataJudicialSource from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'name': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'url': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if url (nullable) is None + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: + _dict['url'] = None - attribute_map = { - 'name': 'name', # noqa: E501 - 'type': 'type', # noqa: E501 - 'url': 'url', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, type, url, *args, **kwargs): # noqa: E501 - """NormJudgePublicDataJudicialSource - a model defined in OpenAPI - - Args: - name (str): Name of the Judicial Data Source - type (str): Type of acquisition of the data source - url (str, none_type): URL of the data source, if type is Website - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name = name - self.type = type - self.url = url - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, type, url, *args, **kwargs): # noqa: E501 - """NormJudgePublicDataJudicialSource - a model defined in OpenAPI - - Args: - name (str): Name of the Judicial Data Source - type (str): Type of acquisition of the data source - url (str, none_type): URL of the data source, if type is Website - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormJudgePublicDataJudicialSource from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "name": obj.get("name"), + "type": obj.get("type"), + "url": obj.get("url") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.name = name - self.type = type - self.url = url - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_judge_public_data_name_history_array_inner.py b/unicourt/model/norm_judge_public_data_name_history_array_inner.py index 31947ce..6d21728 100644 --- a/unicourt/model/norm_judge_public_data_name_history_array_inner.py +++ b/unicourt/model/norm_judge_public_data_name_history_array_inner.py @@ -1,314 +1,123 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class NormJudgePublicDataNameHistoryArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class NormJudgePublicDataNameHistoryArrayInner(BaseModel): """ + NormJudgePublicDataNameHistoryArrayInner + """ # noqa: E501 + first_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="firstName") + middle_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="middleName") + last_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="lastName") + prefix: Optional[Annotated[str, Field(strict=True, max_length=5)]] = None + suffix: Optional[Annotated[str, Field(strict=True, max_length=5)]] = None + is_visible: Optional[StrictBool] = Field(default=None, alias="isVisible") + __properties: ClassVar[List[str]] = ["firstName", "middleName", "lastName", "prefix", "suffix", "isVisible"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('first_name',): { - 'max_length': 500, - }, - ('middle_name',): { - 'max_length': 500, - }, - ('last_name',): { - 'max_length': 500, - }, - ('prefix',): { - 'max_length': 5, - }, - ('suffix',): { - 'max_length': 5, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormJudgePublicDataNameHistoryArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'first_name': (str, none_type,), # noqa: E501 - 'middle_name': (str, none_type,), # noqa: E501 - 'last_name': (str, none_type,), # noqa: E501 - 'prefix': (str, none_type,), # noqa: E501 - 'suffix': (str, none_type,), # noqa: E501 - 'is_visible': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'first_name': 'firstName', # noqa: E501 - 'middle_name': 'middleName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - 'prefix': 'prefix', # noqa: E501 - 'suffix': 'suffix', # noqa: E501 - 'is_visible': 'isVisible', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['firstName'] = None + + # set to None if middle_name (nullable) is None + # and model_fields_set contains the field + if self.middle_name is None and "middle_name" in self.model_fields_set: + _dict['middleName'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['lastName'] = None + + # set to None if prefix (nullable) is None + # and model_fields_set contains the field + if self.prefix is None and "prefix" in self.model_fields_set: + _dict['prefix'] = None + + # set to None if suffix (nullable) is None + # and model_fields_set contains the field + if self.suffix is None and "suffix" in self.model_fields_set: + _dict['suffix'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, first_name, middle_name, last_name, prefix, suffix, is_visible, *args, **kwargs): # noqa: E501 - """NormJudgePublicDataNameHistoryArrayInner - a model defined in OpenAPI - - Args: - first_name (str, none_type): - middle_name (str, none_type): - last_name (str, none_type): - prefix (str, none_type): - suffix (str, none_type): - is_visible (bool): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.prefix = prefix - self.suffix = suffix - self.is_visible = is_visible - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, first_name, middle_name, last_name, prefix, suffix, is_visible, *args, **kwargs): # noqa: E501 - """NormJudgePublicDataNameHistoryArrayInner - a model defined in OpenAPI - - Args: - first_name (str, none_type): - middle_name (str, none_type): - last_name (str, none_type): - prefix (str, none_type): - suffix (str, none_type): - is_visible (bool): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormJudgePublicDataNameHistoryArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "firstName": obj.get("firstName"), + "middleName": obj.get("middleName"), + "lastName": obj.get("lastName"), + "prefix": obj.get("prefix"), + "suffix": obj.get("suffix"), + "isVisible": obj.get("isVisible") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.prefix = prefix - self.suffix = suffix - self.is_visible = is_visible - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_judge_search_response.py b/unicourt/model/norm_judge_search_response.py index 811ab5a..0989c35 100644 --- a/unicourt/model/norm_judge_search_response.py +++ b/unicourt/model/norm_judge_search_response.py @@ -1,353 +1,122 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.norm_judge_search_result import NormJudgeSearchResult - globals()['NormJudgeSearchResult'] = NormJudgeSearchResult - - -class NormJudgeSearchResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 23, - 'min_length': 23, - }, - ('norm_judge_search_result_array',): { - }, - ('q',): { - 'max_length': 2048, - 'min_length': 3, - }, - ('norm_judge_search_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('next_page_api',): { - 'max_length': 2117, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2116, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_judge_search_result_array': ([NormJudgeSearchResult],), # noqa: E501 - 'q': (str,), # noqa: E501 - 'norm_judge_search_id': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_judge_search_result_array': 'normJudgeSearchResultArray', # noqa: E501 - 'q': 'q', # noqa: E501 - 'norm_judge_search_id': 'normJudgeSearchId', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.norm_judge_search_result import NormJudgeSearchResult +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class NormJudgeSearchResponse(BaseModel): + """ + NormJudgeSearchResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=23, strict=True, max_length=23)]] = 'NormJudgeSearchResponse' + norm_judge_search_result_array: Optional[List[NormJudgeSearchResult]] = Field(default=None, alias="normJudgeSearchResultArray") + q: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2048)]] = Field(default=None, description="Query been sent by client") + norm_judge_search_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Query been sent by client", alias="normJudgeSearchId") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2117)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2116)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total pages for matches that were found in the index.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="The number of matches that were found in the index.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "normJudgeSearchResultArray", "q", "normJudgeSearchId", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_judge_search_result_array, q, norm_judge_search_id, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """NormJudgeSearchResponse - a model defined in OpenAPI - - Args: - norm_judge_search_result_array ([NormJudgeSearchResult]): - q (str): Query been sent by client - norm_judge_search_id (str): Query been sent by client - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): - total_pages (int): Total pages for matches that were found in the index. - total_count (int): The number of matches that were found in the index. - - Keyword Args: - object (str): defaults to "NormJudgeSearchResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "NormJudgeSearchResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormJudgeSearchResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_judge_search_result_array = norm_judge_search_result_array - self.q = q - self.norm_judge_search_id = norm_judge_search_id - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_judge_search_result_array, q, norm_judge_search_id, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """NormJudgeSearchResponse - a model defined in OpenAPI - - Args: - norm_judge_search_result_array ([NormJudgeSearchResult]): - q (str): Query been sent by client - norm_judge_search_id (str): Query been sent by client - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): - total_pages (int): Total pages for matches that were found in the index. - total_count (int): The number of matches that were found in the index. - - Keyword Args: - object (str): defaults to "NormJudgeSearchResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in norm_judge_search_result_array (list) + _items = [] + if self.norm_judge_search_result_array: + for _item in self.norm_judge_search_result_array: + if _item: + _items.append(_item.to_dict()) + _dict['normJudgeSearchResultArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "NormJudgeSearchResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormJudgeSearchResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormJudgeSearchResponse', + "normJudgeSearchResultArray": [NormJudgeSearchResult.from_dict(_item) for _item in obj["normJudgeSearchResultArray"]] if obj.get("normJudgeSearchResultArray") is not None else None, + "q": obj.get("q"), + "normJudgeSearchId": obj.get("normJudgeSearchId"), + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_judge_search_result_array = norm_judge_search_result_array - self.q = q - self.norm_judge_search_id = norm_judge_search_id - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_judge_search_result.py b/unicourt/model/norm_judge_search_result.py index f8673e6..908d314 100644 --- a/unicourt/model/norm_judge_search_result.py +++ b/unicourt/model/norm_judge_search_result.py @@ -1,337 +1,109 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.matched_object import MatchedObject - globals()['MatchedObject'] = MatchedObject - - -class NormJudgeSearchResult(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 21, - 'min_length': 21, - }, - ('norm_judge_id',): { - 'max_length': 18, - 'min_length': 17, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('norm_judge_details_api',): { - 'max_length': 255, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_judge_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'first_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date': (datetime,), # noqa: E501 - 'norm_judge_details_api': (str,), # noqa: E501 - 'matched_object_array': ([MatchedObject],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_judge_id': 'normJudgeId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'norm_judge_details_api': 'normJudgeDetailsAPI', # noqa: E501 - 'matched_object_array': 'matchedObjectArray', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.matched_object import MatchedObject +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class NormJudgeSearchResult(BaseModel): + """ + NormJudgeSearchResult + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=21, strict=True, max_length=21)]] = 'NormJudgeSearchResult' + norm_judge_id: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=18)]] = Field(default=None, alias="normJudgeId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + first_fetch_date: Optional[datetime] = Field(default=None, alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, alias="lastFetchDate") + norm_judge_details_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="normJudgeDetailsAPI") + matched_object_array: Optional[List[MatchedObject]] = Field(default=None, alias="matchedObjectArray") + __properties: ClassVar[List[str]] = ["object", "normJudgeId", "name", "firstFetchDate", "lastFetchDate", "normJudgeDetailsAPI", "matchedObjectArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_judge_id, name, first_fetch_date, last_fetch_date, norm_judge_details_api, matched_object_array, *args, **kwargs): # noqa: E501 - """NormJudgeSearchResult - a model defined in OpenAPI - - Args: - norm_judge_id (str): - name (str): - first_fetch_date (datetime): - last_fetch_date (datetime): - norm_judge_details_api (str): - matched_object_array ([MatchedObject]): - - Keyword Args: - object (str): defaults to "NormJudgeSearchResult" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "NormJudgeSearchResult") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormJudgeSearchResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_judge_id = norm_judge_id - self.name = name - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.norm_judge_details_api = norm_judge_details_api - self.matched_object_array = matched_object_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_judge_id, name, first_fetch_date, last_fetch_date, norm_judge_details_api, matched_object_array, *args, **kwargs): # noqa: E501 - """NormJudgeSearchResult - a model defined in OpenAPI - - Args: - norm_judge_id (str): - name (str): - first_fetch_date (datetime): - last_fetch_date (datetime): - norm_judge_details_api (str): - matched_object_array ([MatchedObject]): - - Keyword Args: - object (str): defaults to "NormJudgeSearchResult" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in matched_object_array (list) + _items = [] + if self.matched_object_array: + for _item in self.matched_object_array: + if _item: + _items.append(_item.to_dict()) + _dict['matchedObjectArray'] = _items + return _dict - object = kwargs.get('object', "NormJudgeSearchResult") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormJudgeSearchResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormJudgeSearchResult', + "normJudgeId": obj.get("normJudgeId"), + "name": obj.get("name"), + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate"), + "normJudgeDetailsAPI": obj.get("normJudgeDetailsAPI"), + "matchedObjectArray": [MatchedObject.from_dict(_item) for _item in obj["matchedObjectArray"]] if obj.get("matchedObjectArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_judge_id = norm_judge_id - self.name = name - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.norm_judge_details_api = norm_judge_details_api - self.matched_object_array = matched_object_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_law_firm.py b/unicourt/model/norm_law_firm.py index 1f9154c..dad871e 100644 --- a/unicourt/model/norm_law_firm.py +++ b/unicourt/model/norm_law_firm.py @@ -1,330 +1,112 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_analytics_api import CaseAnalyticsAPI - from unicourt.model.law_firm_analytics_api import LawFirmAnalyticsAPI - from unicourt.model.norm_organization import NormOrganization - globals()['CaseAnalyticsAPI'] = CaseAnalyticsAPI - globals()['LawFirmAnalyticsAPI'] = LawFirmAnalyticsAPI - globals()['NormOrganization'] = NormOrganization - - -class NormLawFirm(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 11, - }, - ('norm_law_firm_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 500, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_law_firm_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'case_analytics_api': (CaseAnalyticsAPI,), # noqa: E501 - 'norm_organization_data': (NormOrganization,), # noqa: E501 - 'law_firm_analytics_api': (LawFirmAnalyticsAPI,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_law_firm_id': 'normLawFirmId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_analytics_api': 'caseAnalyticsAPI', # noqa: E501 - 'norm_organization_data': 'normOrganizationData', # noqa: E501 - 'law_firm_analytics_api': 'lawFirmAnalyticsAPI', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_analytics_api import CaseAnalyticsAPI +from unicourt.model.law_firm_analytics_api import LawFirmAnalyticsAPI +from unicourt.model.norm_organization import NormOrganization +from typing import Optional, Set +from typing_extensions import Self + +class NormLawFirm(BaseModel): + """ + Schema for Norm Law Firm containing Organization sub-field. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=11)]] = 'NormLawFirm' + norm_law_firm_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normLawFirmId") + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseSearchAPI") + case_analytics_api: Optional[CaseAnalyticsAPI] = Field(default=None, alias="caseAnalyticsAPI") + norm_organization_data: Optional[NormOrganization] = Field(default=None, alias="normOrganizationData") + law_firm_analytics_api: Optional[LawFirmAnalyticsAPI] = Field(default=None, alias="lawFirmAnalyticsAPI") + __properties: ClassVar[List[str]] = ["object", "normLawFirmId", "name", "caseSearchAPI", "caseAnalyticsAPI", "normOrganizationData", "lawFirmAnalyticsAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_law_firm_id, name, case_search_api, case_analytics_api, norm_organization_data, law_firm_analytics_api, *args, **kwargs): # noqa: E501 - """NormLawFirm - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormLawFirm from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - norm_law_firm_id (str): - name (str): - case_search_api (str): - case_analytics_api (CaseAnalyticsAPI): - norm_organization_data (NormOrganization): - law_firm_analytics_api (LawFirmAnalyticsAPI): - - Keyword Args: - object (str): defaults to "NormLawFirm" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "NormLawFirm") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_law_firm_id = norm_law_firm_id - self.name = name - self.case_search_api = case_search_api - self.case_analytics_api = case_analytics_api - self.norm_organization_data = norm_organization_data - self.law_firm_analytics_api = law_firm_analytics_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_law_firm_id, name, case_search_api, case_analytics_api, norm_organization_data, law_firm_analytics_api, *args, **kwargs): # noqa: E501 - """NormLawFirm - a model defined in OpenAPI - - Args: - norm_law_firm_id (str): - name (str): - case_search_api (str): - case_analytics_api (CaseAnalyticsAPI): - norm_organization_data (NormOrganization): - law_firm_analytics_api (LawFirmAnalyticsAPI): - - Keyword Args: - object (str): defaults to "NormLawFirm" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_analytics_api + if self.case_analytics_api: + _dict['caseAnalyticsAPI'] = self.case_analytics_api.to_dict() + # override the default output from pydantic by calling `to_dict()` of norm_organization_data + if self.norm_organization_data: + _dict['normOrganizationData'] = self.norm_organization_data.to_dict() + # override the default output from pydantic by calling `to_dict()` of law_firm_analytics_api + if self.law_firm_analytics_api: + _dict['lawFirmAnalyticsAPI'] = self.law_firm_analytics_api.to_dict() + return _dict - object = kwargs.get('object', "NormLawFirm") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormLawFirm from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormLawFirm', + "normLawFirmId": obj.get("normLawFirmId"), + "name": obj.get("name"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseAnalyticsAPI": CaseAnalyticsAPI.from_dict(obj["caseAnalyticsAPI"]) if obj.get("caseAnalyticsAPI") is not None else None, + "normOrganizationData": NormOrganization.from_dict(obj["normOrganizationData"]) if obj.get("normOrganizationData") is not None else None, + "lawFirmAnalyticsAPI": LawFirmAnalyticsAPI.from_dict(obj["lawFirmAnalyticsAPI"]) if obj.get("lawFirmAnalyticsAPI") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_law_firm_id = norm_law_firm_id - self.name = name - self.case_search_api = case_search_api - self.case_analytics_api = case_analytics_api - self.norm_organization_data = norm_organization_data - self.law_firm_analytics_api = law_firm_analytics_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_law_firm_search_response.py b/unicourt/model/norm_law_firm_search_response.py index f942536..c9cac46 100644 --- a/unicourt/model/norm_law_firm_search_response.py +++ b/unicourt/model/norm_law_firm_search_response.py @@ -1,353 +1,122 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.norm_law_firm_search_result import NormLawFirmSearchResult - globals()['NormLawFirmSearchResult'] = NormLawFirmSearchResult - - -class NormLawFirmSearchResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 25, - 'min_length': 25, - }, - ('norm_law_firm_search_result_array',): { - }, - ('q',): { - 'max_length': 2048, - 'min_length': 3, - }, - ('norm_law_firm_search_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('next_page_api',): { - 'max_length': 2119, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2118, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_law_firm_search_result_array': ([NormLawFirmSearchResult],), # noqa: E501 - 'q': (str,), # noqa: E501 - 'norm_law_firm_search_id': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_law_firm_search_result_array': 'normLawFirmSearchResultArray', # noqa: E501 - 'q': 'q', # noqa: E501 - 'norm_law_firm_search_id': 'normLawFirmSearchId', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.norm_law_firm_search_result import NormLawFirmSearchResult +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class NormLawFirmSearchResponse(BaseModel): + """ + NormLawFirmSearchResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = 'NormLawFirmSearchResponse' + norm_law_firm_search_result_array: Optional[List[NormLawFirmSearchResult]] = Field(default=None, alias="normLawFirmSearchResultArray") + q: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2048)]] = Field(default=None, description="Query been sent by client") + norm_law_firm_search_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Query been sent by client", alias="normLawFirmSearchId") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2119)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2118)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total pages for matches that were found in the index.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="The number of matches that were found in the index.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "normLawFirmSearchResultArray", "q", "normLawFirmSearchId", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_law_firm_search_result_array, q, norm_law_firm_search_id, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """NormLawFirmSearchResponse - a model defined in OpenAPI - - Args: - norm_law_firm_search_result_array ([NormLawFirmSearchResult]): - q (str): Query been sent by client - norm_law_firm_search_id (str): Query been sent by client - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): - total_pages (int): Total pages for matches that were found in the index. - total_count (int): The number of matches that were found in the index. - - Keyword Args: - object (str): defaults to "NormLawFirmSearchResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "NormLawFirmSearchResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormLawFirmSearchResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_law_firm_search_result_array = norm_law_firm_search_result_array - self.q = q - self.norm_law_firm_search_id = norm_law_firm_search_id - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_law_firm_search_result_array, q, norm_law_firm_search_id, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """NormLawFirmSearchResponse - a model defined in OpenAPI - - Args: - norm_law_firm_search_result_array ([NormLawFirmSearchResult]): - q (str): Query been sent by client - norm_law_firm_search_id (str): Query been sent by client - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): - total_pages (int): Total pages for matches that were found in the index. - total_count (int): The number of matches that were found in the index. - - Keyword Args: - object (str): defaults to "NormLawFirmSearchResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in norm_law_firm_search_result_array (list) + _items = [] + if self.norm_law_firm_search_result_array: + for _item in self.norm_law_firm_search_result_array: + if _item: + _items.append(_item.to_dict()) + _dict['normLawFirmSearchResultArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "NormLawFirmSearchResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormLawFirmSearchResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormLawFirmSearchResponse', + "normLawFirmSearchResultArray": [NormLawFirmSearchResult.from_dict(_item) for _item in obj["normLawFirmSearchResultArray"]] if obj.get("normLawFirmSearchResultArray") is not None else None, + "q": obj.get("q"), + "normLawFirmSearchId": obj.get("normLawFirmSearchId"), + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_law_firm_search_result_array = norm_law_firm_search_result_array - self.q = q - self.norm_law_firm_search_id = norm_law_firm_search_id - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_law_firm_search_result.py b/unicourt/model/norm_law_firm_search_result.py index 3231050..8a473a2 100644 --- a/unicourt/model/norm_law_firm_search_result.py +++ b/unicourt/model/norm_law_firm_search_result.py @@ -1,337 +1,109 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.matched_object import MatchedObject - globals()['MatchedObject'] = MatchedObject - - -class NormLawFirmSearchResult(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 23, - 'min_length': 23, - }, - ('norm_law_firm_id',): { - 'max_length': 18, - 'min_length': 17, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('norm_law_firm_details_api',): { - 'max_length': 255, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_law_firm_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'first_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date': (datetime,), # noqa: E501 - 'norm_law_firm_details_api': (str,), # noqa: E501 - 'matched_object_array': ([MatchedObject],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_law_firm_id': 'normLawFirmId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'norm_law_firm_details_api': 'normLawFirmDetailsAPI', # noqa: E501 - 'matched_object_array': 'matchedObjectArray', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.matched_object import MatchedObject +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class NormLawFirmSearchResult(BaseModel): + """ + NormLawFirmSearchResult + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=23, strict=True, max_length=23)]] = 'NormLawFirmSearchResult' + norm_law_firm_id: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=18)]] = Field(default=None, alias="normLawFirmId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + first_fetch_date: Optional[datetime] = Field(default=None, alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, alias="lastFetchDate") + norm_law_firm_details_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="normLawFirmDetailsAPI") + matched_object_array: Optional[List[MatchedObject]] = Field(default=None, alias="matchedObjectArray") + __properties: ClassVar[List[str]] = ["object", "normLawFirmId", "name", "firstFetchDate", "lastFetchDate", "normLawFirmDetailsAPI", "matchedObjectArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_law_firm_id, name, first_fetch_date, last_fetch_date, norm_law_firm_details_api, matched_object_array, *args, **kwargs): # noqa: E501 - """NormLawFirmSearchResult - a model defined in OpenAPI - - Args: - norm_law_firm_id (str): - name (str): - first_fetch_date (datetime): - last_fetch_date (datetime): - norm_law_firm_details_api (str): - matched_object_array ([MatchedObject]): - - Keyword Args: - object (str): defaults to "NormLawFirmSearchResult" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "NormLawFirmSearchResult") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormLawFirmSearchResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_law_firm_id = norm_law_firm_id - self.name = name - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.norm_law_firm_details_api = norm_law_firm_details_api - self.matched_object_array = matched_object_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_law_firm_id, name, first_fetch_date, last_fetch_date, norm_law_firm_details_api, matched_object_array, *args, **kwargs): # noqa: E501 - """NormLawFirmSearchResult - a model defined in OpenAPI - - Args: - norm_law_firm_id (str): - name (str): - first_fetch_date (datetime): - last_fetch_date (datetime): - norm_law_firm_details_api (str): - matched_object_array ([MatchedObject]): - - Keyword Args: - object (str): defaults to "NormLawFirmSearchResult" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in matched_object_array (list) + _items = [] + if self.matched_object_array: + for _item in self.matched_object_array: + if _item: + _items.append(_item.to_dict()) + _dict['matchedObjectArray'] = _items + return _dict - object = kwargs.get('object', "NormLawFirmSearchResult") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormLawFirmSearchResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormLawFirmSearchResult', + "normLawFirmId": obj.get("normLawFirmId"), + "name": obj.get("name"), + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate"), + "normLawFirmDetailsAPI": obj.get("normLawFirmDetailsAPI"), + "matchedObjectArray": [MatchedObject.from_dict(_item) for _item in obj["matchedObjectArray"]] if obj.get("matchedObjectArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_law_firm_id = norm_law_firm_id - self.name = name - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.norm_law_firm_details_api = norm_law_firm_details_api - self.matched_object_array = matched_object_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_organization.py b/unicourt/model/norm_organization.py index 30cb6fd..8501ccc 100644 --- a/unicourt/model/norm_organization.py +++ b/unicourt/model/norm_organization.py @@ -1,405 +1,180 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.norm_corporate_group import NormCorporateGroup - from unicourt.model.norm_organization_ticker_array_inner import NormOrganizationTickerArrayInner - from unicourt.model.sos_data import SOSData - globals()['NormCorporateGroup'] = NormCorporateGroup - globals()['NormOrganizationTickerArrayInner'] = NormOrganizationTickerArrayInner - globals()['SOSData'] = SOSData - - -class NormOrganization(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('organization_type',): { - 'BUSINESS': "Business", - 'GOVERNMENTAGENCY': "GovernmentAgency", - }, - } - - validations = { - ('object',): { - 'max_length': 16, - }, - ('norm_organization_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 500, - }, - ('organization_type',): { - 'max_length': 100, - }, - ('lei',): { - 'max_length': 250, - }, - ('cik',): { - 'max_length': 15, - }, - ('ticker_array',): { - }, - ('naics',): { - 'max_length': 250, - }, - ('naics_description',): { - 'max_length': 250, - }, - ('sic',): { - 'max_length': 10, - }, - ('sic_description',): { - 'max_length': 100, - }, - ('norm_party_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_organization_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'organization_type': (str,), # noqa: E501 - 'lei': (str, none_type,), # noqa: E501 - 'cik': (str, none_type,), # noqa: E501 - 'ticker_array': ([NormOrganizationTickerArrayInner],), # noqa: E501 - 'naics': (str, none_type,), # noqa: E501 - 'naics_description': (str, none_type,), # noqa: E501 - 'sic': (str, none_type,), # noqa: E501 - 'sic_description': (str, none_type,), # noqa: E501 - 'is_involved_in_litigation': (bool,), # noqa: E501 - 'norm_party_api': (str,), # noqa: E501 - 'norm_corporate_group_array': ([NormCorporateGroup],), # noqa: E501 - 'sos_data_array': ([SOSData],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_organization_id': 'normOrganizationId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'organization_type': 'organizationType', # noqa: E501 - 'lei': 'lei', # noqa: E501 - 'cik': 'cik', # noqa: E501 - 'ticker_array': 'tickerArray', # noqa: E501 - 'naics': 'naics', # noqa: E501 - 'naics_description': 'naicsDescription', # noqa: E501 - 'sic': 'sic', # noqa: E501 - 'sic_description': 'sicDescription', # noqa: E501 - 'is_involved_in_litigation': 'isInvolvedInLitigation', # noqa: E501 - 'norm_party_api': 'normPartyAPI', # noqa: E501 - 'norm_corporate_group_array': 'normCorporateGroupArray', # noqa: E501 - 'sos_data_array': 'sosDataArray', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.norm_corporate_group import NormCorporateGroup +from unicourt.model.norm_organization_ticker_array_inner import NormOrganizationTickerArrayInner +from unicourt.model.sos_data import SOSData +from typing import Optional, Set +from typing_extensions import Self + +class NormOrganization(BaseModel): + """ + NormOrganization + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=16)]] = 'NormOrganization' + norm_organization_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normOrganizationId") + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + organization_type: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, alias="organizationType") + lei: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + cik: Optional[Annotated[str, Field(strict=True, max_length=15)]] = None + ticker_array: Optional[List[NormOrganizationTickerArrayInner]] = Field(default=None, alias="tickerArray") + naics: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + naics_description: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="naicsDescription") + sic: Optional[Annotated[str, Field(strict=True, max_length=10)]] = None + sic_description: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, alias="sicDescription") + is_involved_in_litigation: Optional[StrictBool] = Field(default=None, alias="isInvolvedInLitigation") + norm_party_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="normPartyAPI") + norm_corporate_group_array: Optional[List[NormCorporateGroup]] = Field(default=None, alias="normCorporateGroupArray") + sos_data_array: Optional[List[SOSData]] = Field(default=None, alias="sosDataArray") + __properties: ClassVar[List[str]] = ["object", "normOrganizationId", "name", "organizationType", "lei", "cik", "tickerArray", "naics", "naicsDescription", "sic", "sicDescription", "isInvolvedInLitigation", "normPartyAPI", "normCorporateGroupArray", "sosDataArray"] + + @field_validator('organization_type') + def organization_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Business', 'GovernmentAgency']): + raise ValueError("must be one of enum values ('Business', 'GovernmentAgency')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_organization_id, name, organization_type, lei, cik, ticker_array, naics, naics_description, sic, sic_description, is_involved_in_litigation, norm_party_api, norm_corporate_group_array, sos_data_array, *args, **kwargs): # noqa: E501 - """NormOrganization - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormOrganization from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - norm_organization_id (str): - name (str): - organization_type (str): - lei (str, none_type): - cik (str, none_type): - ticker_array ([NormOrganizationTickerArrayInner]): - naics (str, none_type): - naics_description (str, none_type): - sic (str, none_type): - sic_description (str, none_type): - is_involved_in_litigation (bool): - norm_party_api (str): - norm_corporate_group_array ([NormCorporateGroup]): - sos_data_array ([SOSData]): - - Keyword Args: - object (str): defaults to "NormOrganization" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "NormOrganization") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_organization_id = norm_organization_id - self.name = name - self.organization_type = organization_type - self.lei = lei - self.cik = cik - self.ticker_array = ticker_array - self.naics = naics - self.naics_description = naics_description - self.sic = sic - self.sic_description = sic_description - self.is_involved_in_litigation = is_involved_in_litigation - self.norm_party_api = norm_party_api - self.norm_corporate_group_array = norm_corporate_group_array - self.sos_data_array = sos_data_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_organization_id, name, organization_type, lei, cik, ticker_array, naics, naics_description, sic, sic_description, is_involved_in_litigation, norm_party_api, norm_corporate_group_array, sos_data_array, *args, **kwargs): # noqa: E501 - """NormOrganization - a model defined in OpenAPI - - Args: - norm_organization_id (str): - name (str): - organization_type (str): - lei (str, none_type): - cik (str, none_type): - ticker_array ([NormOrganizationTickerArrayInner]): - naics (str, none_type): - naics_description (str, none_type): - sic (str, none_type): - sic_description (str, none_type): - is_involved_in_litigation (bool): - norm_party_api (str): - norm_corporate_group_array ([NormCorporateGroup]): - sos_data_array ([SOSData]): - - Keyword Args: - object (str): defaults to "NormOrganization" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in ticker_array (list) + _items = [] + if self.ticker_array: + for _item in self.ticker_array: + if _item: + _items.append(_item.to_dict()) + _dict['tickerArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in norm_corporate_group_array (list) + _items = [] + if self.norm_corporate_group_array: + for _item in self.norm_corporate_group_array: + if _item: + _items.append(_item.to_dict()) + _dict['normCorporateGroupArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in sos_data_array (list) + _items = [] + if self.sos_data_array: + for _item in self.sos_data_array: + if _item: + _items.append(_item.to_dict()) + _dict['sosDataArray'] = _items + # set to None if lei (nullable) is None + # and model_fields_set contains the field + if self.lei is None and "lei" in self.model_fields_set: + _dict['lei'] = None + + # set to None if cik (nullable) is None + # and model_fields_set contains the field + if self.cik is None and "cik" in self.model_fields_set: + _dict['cik'] = None + + # set to None if naics (nullable) is None + # and model_fields_set contains the field + if self.naics is None and "naics" in self.model_fields_set: + _dict['naics'] = None + + # set to None if naics_description (nullable) is None + # and model_fields_set contains the field + if self.naics_description is None and "naics_description" in self.model_fields_set: + _dict['naicsDescription'] = None + + # set to None if sic (nullable) is None + # and model_fields_set contains the field + if self.sic is None and "sic" in self.model_fields_set: + _dict['sic'] = None + + # set to None if sic_description (nullable) is None + # and model_fields_set contains the field + if self.sic_description is None and "sic_description" in self.model_fields_set: + _dict['sicDescription'] = None + + return _dict - object = kwargs.get('object', "NormOrganization") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormOrganization from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormOrganization', + "normOrganizationId": obj.get("normOrganizationId"), + "name": obj.get("name"), + "organizationType": obj.get("organizationType"), + "lei": obj.get("lei"), + "cik": obj.get("cik"), + "tickerArray": [NormOrganizationTickerArrayInner.from_dict(_item) for _item in obj["tickerArray"]] if obj.get("tickerArray") is not None else None, + "naics": obj.get("naics"), + "naicsDescription": obj.get("naicsDescription"), + "sic": obj.get("sic"), + "sicDescription": obj.get("sicDescription"), + "isInvolvedInLitigation": obj.get("isInvolvedInLitigation"), + "normPartyAPI": obj.get("normPartyAPI"), + "normCorporateGroupArray": [NormCorporateGroup.from_dict(_item) for _item in obj["normCorporateGroupArray"]] if obj.get("normCorporateGroupArray") is not None else None, + "sosDataArray": [SOSData.from_dict(_item) for _item in obj["sosDataArray"]] if obj.get("sosDataArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_organization_id = norm_organization_id - self.name = name - self.organization_type = organization_type - self.lei = lei - self.cik = cik - self.ticker_array = ticker_array - self.naics = naics - self.naics_description = naics_description - self.sic = sic - self.sic_description = sic_description - self.is_involved_in_litigation = is_involved_in_litigation - self.norm_party_api = norm_party_api - self.norm_corporate_group_array = norm_corporate_group_array - self.sos_data_array = sos_data_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_organization_ticker_array_inner.py b/unicourt/model/norm_organization_ticker_array_inner.py index 6614535..e435166 100644 --- a/unicourt/model/norm_organization_ticker_array_inner.py +++ b/unicourt/model/norm_organization_ticker_array_inner.py @@ -1,278 +1,95 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class NormOrganizationTickerArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('exchange',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'exchange': (str, none_type,), # noqa: E501 - 'symbols': ([str],), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class NormOrganizationTickerArrayInner(BaseModel): + """ + NormOrganizationTickerArrayInner + """ # noqa: E501 + exchange: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + symbols: Optional[List[Annotated[str, Field(strict=True, max_length=250)]]] = None + __properties: ClassVar[List[str]] = ["exchange", "symbols"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'exchange': 'exchange', # noqa: E501 - 'symbols': 'symbols', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, exchange, symbols, *args, **kwargs): # noqa: E501 - """NormOrganizationTickerArrayInner - a model defined in OpenAPI - - Args: - exchange (str, none_type): - symbols ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormOrganizationTickerArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self.exchange = exchange - self.symbols = symbols - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - @convert_js_args_to_python_args - def __init__(self, exchange, symbols, *args, **kwargs): # noqa: E501 - """NormOrganizationTickerArrayInner - a model defined in OpenAPI + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if exchange (nullable) is None + # and model_fields_set contains the field + if self.exchange is None and "exchange" in self.model_fields_set: + _dict['exchange'] = None - Args: - exchange (str, none_type): - symbols ([str]): + return _dict - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormOrganizationTickerArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "exchange": obj.get("exchange"), + "symbols": obj.get("symbols") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.exchange = exchange - self.symbols = symbols - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_party.py b/unicourt/model/norm_party.py index 3dd6e6d..fdca078 100644 --- a/unicourt/model/norm_party.py +++ b/unicourt/model/norm_party.py @@ -1,359 +1,140 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_analytics_api import CaseAnalyticsAPI - from unicourt.model.individual import Individual - from unicourt.model.norm_organization import NormOrganization - from unicourt.model.party_analytics_api import PartyAnalyticsAPI - from unicourt.model.related_norm_party import RelatedNormParty - globals()['CaseAnalyticsAPI'] = CaseAnalyticsAPI - globals()['Individual'] = Individual - globals()['NormOrganization'] = NormOrganization - globals()['PartyAnalyticsAPI'] = PartyAnalyticsAPI - globals()['RelatedNormParty'] = RelatedNormParty - - -class NormParty(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('party_classification_type',): { - 'INDIVIDUAL': "Individual", - 'ORGANIZATION': "Organization", - }, - } - - validations = { - ('object',): { - 'max_length': 9, - }, - ('norm_party_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 500, - }, - ('party_classification_type',): { - 'max_length': 12, - }, - ('case_search_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_party_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'party_classification_type': (str,), # noqa: E501 - 'case_search_api': (str,), # noqa: E501 - 'case_analytics_api': (CaseAnalyticsAPI,), # noqa: E501 - 'individual_data': (Individual,), # noqa: E501 - 'norm_organization_data': (NormOrganization,), # noqa: E501 - 'party_analytics_api': (PartyAnalyticsAPI,), # noqa: E501 - 'related_norm_party_array': ([RelatedNormParty],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_party_id': 'normPartyId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'party_classification_type': 'partyClassificationType', # noqa: E501 - 'case_search_api': 'caseSearchAPI', # noqa: E501 - 'case_analytics_api': 'caseAnalyticsAPI', # noqa: E501 - 'individual_data': 'individualData', # noqa: E501 - 'norm_organization_data': 'normOrganizationData', # noqa: E501 - 'party_analytics_api': 'partyAnalyticsAPI', # noqa: E501 - 'related_norm_party_array': 'relatedNormPartyArray', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_analytics_api import CaseAnalyticsAPI +from unicourt.model.individual import Individual +from unicourt.model.norm_organization import NormOrganization +from unicourt.model.party_analytics_api import PartyAnalyticsAPI +from unicourt.model.related_norm_party import RelatedNormParty +from typing import Optional, Set +from typing_extensions import Self + +class NormParty(BaseModel): + """ + Norm Party + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=9)]] = 'NormParty' + norm_party_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normPartyId") + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + party_classification_type: Optional[Annotated[str, Field(strict=True, max_length=12)]] = Field(default=None, alias="partyClassificationType") + case_search_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseSearchAPI") + case_analytics_api: Optional[CaseAnalyticsAPI] = Field(default=None, alias="caseAnalyticsAPI") + individual_data: Optional[Individual] = Field(default=None, alias="individualData") + norm_organization_data: Optional[NormOrganization] = Field(default=None, alias="normOrganizationData") + party_analytics_api: Optional[PartyAnalyticsAPI] = Field(default=None, alias="partyAnalyticsAPI") + related_norm_party_array: Optional[List[RelatedNormParty]] = Field(default=None, alias="relatedNormPartyArray") + __properties: ClassVar[List[str]] = ["object", "normPartyId", "name", "partyClassificationType", "caseSearchAPI", "caseAnalyticsAPI", "individualData", "normOrganizationData", "partyAnalyticsAPI", "relatedNormPartyArray"] + + @field_validator('party_classification_type') + def party_classification_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Individual', 'Organization']): + raise ValueError("must be one of enum values ('Individual', 'Organization')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_party_id, name, party_classification_type, case_search_api, case_analytics_api, individual_data, norm_organization_data, party_analytics_api, related_norm_party_array, *args, **kwargs): # noqa: E501 - """NormParty - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormParty from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - norm_party_id (str): - name (str): - party_classification_type (str): - case_search_api (str): - case_analytics_api (CaseAnalyticsAPI): - individual_data (Individual): - norm_organization_data (NormOrganization): - party_analytics_api (PartyAnalyticsAPI): - related_norm_party_array ([RelatedNormParty]): - - Keyword Args: - object (str): defaults to "NormParty" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "NormParty") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_party_id = norm_party_id - self.name = name - self.party_classification_type = party_classification_type - self.case_search_api = case_search_api - self.case_analytics_api = case_analytics_api - self.individual_data = individual_data - self.norm_organization_data = norm_organization_data - self.party_analytics_api = party_analytics_api - self.related_norm_party_array = related_norm_party_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_party_id, name, party_classification_type, case_search_api, case_analytics_api, individual_data, norm_organization_data, party_analytics_api, related_norm_party_array, *args, **kwargs): # noqa: E501 - """NormParty - a model defined in OpenAPI - - Args: - norm_party_id (str): - name (str): - party_classification_type (str): - case_search_api (str): - case_analytics_api (CaseAnalyticsAPI): - individual_data (Individual): - norm_organization_data (NormOrganization): - party_analytics_api (PartyAnalyticsAPI): - related_norm_party_array ([RelatedNormParty]): - - Keyword Args: - object (str): defaults to "NormParty" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_analytics_api + if self.case_analytics_api: + _dict['caseAnalyticsAPI'] = self.case_analytics_api.to_dict() + # override the default output from pydantic by calling `to_dict()` of individual_data + if self.individual_data: + _dict['individualData'] = self.individual_data.to_dict() + # override the default output from pydantic by calling `to_dict()` of norm_organization_data + if self.norm_organization_data: + _dict['normOrganizationData'] = self.norm_organization_data.to_dict() + # override the default output from pydantic by calling `to_dict()` of party_analytics_api + if self.party_analytics_api: + _dict['partyAnalyticsAPI'] = self.party_analytics_api.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in related_norm_party_array (list) + _items = [] + if self.related_norm_party_array: + for _item in self.related_norm_party_array: + if _item: + _items.append(_item.to_dict()) + _dict['relatedNormPartyArray'] = _items + return _dict - object = kwargs.get('object', "NormParty") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormParty from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormParty', + "normPartyId": obj.get("normPartyId"), + "name": obj.get("name"), + "partyClassificationType": obj.get("partyClassificationType"), + "caseSearchAPI": obj.get("caseSearchAPI"), + "caseAnalyticsAPI": CaseAnalyticsAPI.from_dict(obj["caseAnalyticsAPI"]) if obj.get("caseAnalyticsAPI") is not None else None, + "individualData": Individual.from_dict(obj["individualData"]) if obj.get("individualData") is not None else None, + "normOrganizationData": NormOrganization.from_dict(obj["normOrganizationData"]) if obj.get("normOrganizationData") is not None else None, + "partyAnalyticsAPI": PartyAnalyticsAPI.from_dict(obj["partyAnalyticsAPI"]) if obj.get("partyAnalyticsAPI") is not None else None, + "relatedNormPartyArray": [RelatedNormParty.from_dict(_item) for _item in obj["relatedNormPartyArray"]] if obj.get("relatedNormPartyArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_party_id = norm_party_id - self.name = name - self.party_classification_type = party_classification_type - self.case_search_api = case_search_api - self.case_analytics_api = case_analytics_api - self.individual_data = individual_data - self.norm_organization_data = norm_organization_data - self.party_analytics_api = party_analytics_api - self.related_norm_party_array = related_norm_party_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_party_search_response.py b/unicourt/model/norm_party_search_response.py index 0d01073..d6480e5 100644 --- a/unicourt/model/norm_party_search_response.py +++ b/unicourt/model/norm_party_search_response.py @@ -1,353 +1,122 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.norm_party_search_result import NormPartySearchResult - globals()['NormPartySearchResult'] = NormPartySearchResult - - -class NormPartySearchResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 23, - 'min_length': 23, - }, - ('norm_party_search_result_array',): { - }, - ('q',): { - 'max_length': 2048, - 'min_length': 3, - }, - ('norm_party_search_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('next_page_api',): { - 'max_length': 2117, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2116, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_party_search_result_array': ([NormPartySearchResult],), # noqa: E501 - 'q': (str,), # noqa: E501 - 'norm_party_search_id': (str,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_party_search_result_array': 'normPartySearchResultArray', # noqa: E501 - 'q': 'q', # noqa: E501 - 'norm_party_search_id': 'normPartySearchId', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.norm_party_search_result import NormPartySearchResult +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class NormPartySearchResponse(BaseModel): + """ + NormPartySearchResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=23, strict=True, max_length=23)]] = 'NormPartySearchResponse' + norm_party_search_result_array: Optional[List[NormPartySearchResult]] = Field(default=None, alias="normPartySearchResultArray") + q: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2048)]] = Field(default=None, description="Query been sent by client") + norm_party_search_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Query been sent by client", alias="normPartySearchId") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2117)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2116)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total pages for matches that were found in the index.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="The number of matches that were found in the index.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "normPartySearchResultArray", "q", "normPartySearchId", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_party_search_result_array, q, norm_party_search_id, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """NormPartySearchResponse - a model defined in OpenAPI - - Args: - norm_party_search_result_array ([NormPartySearchResult]): - q (str): Query been sent by client - norm_party_search_id (str): Query been sent by client - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): - total_pages (int): Total pages for matches that were found in the index. - total_count (int): The number of matches that were found in the index. - - Keyword Args: - object (str): defaults to "NormPartySearchResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "NormPartySearchResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormPartySearchResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_party_search_result_array = norm_party_search_result_array - self.q = q - self.norm_party_search_id = norm_party_search_id - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_party_search_result_array, q, norm_party_search_id, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """NormPartySearchResponse - a model defined in OpenAPI - - Args: - norm_party_search_result_array ([NormPartySearchResult]): - q (str): Query been sent by client - norm_party_search_id (str): Query been sent by client - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): - total_pages (int): Total pages for matches that were found in the index. - total_count (int): The number of matches that were found in the index. - - Keyword Args: - object (str): defaults to "NormPartySearchResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in norm_party_search_result_array (list) + _items = [] + if self.norm_party_search_result_array: + for _item in self.norm_party_search_result_array: + if _item: + _items.append(_item.to_dict()) + _dict['normPartySearchResultArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "NormPartySearchResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormPartySearchResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormPartySearchResponse', + "normPartySearchResultArray": [NormPartySearchResult.from_dict(_item) for _item in obj["normPartySearchResultArray"]] if obj.get("normPartySearchResultArray") is not None else None, + "q": obj.get("q"), + "normPartySearchId": obj.get("normPartySearchId"), + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_party_search_result_array = norm_party_search_result_array - self.q = q - self.norm_party_search_id = norm_party_search_id - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/norm_party_search_result.py b/unicourt/model/norm_party_search_result.py index 3d90202..968a99e 100644 --- a/unicourt/model/norm_party_search_result.py +++ b/unicourt/model/norm_party_search_result.py @@ -1,347 +1,111 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.matched_object import MatchedObject - globals()['MatchedObject'] = MatchedObject - - -class NormPartySearchResult(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 21, - 'min_length': 21, - }, - ('norm_party_id',): { - 'max_length': 18, - 'min_length': 17, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('party_classification_type',): { - 'max_length': 255, - 'min_length': 1, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('norm_party_details_api',): { - 'max_length': 255, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_party_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'party_classification_type': (str,), # noqa: E501 - 'first_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date': (datetime,), # noqa: E501 - 'norm_party_details_api': (str,), # noqa: E501 - 'matched_object_array': ([MatchedObject],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_party_id': 'normPartyId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'party_classification_type': 'partyClassificationType', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'norm_party_details_api': 'normPartyDetailsAPI', # noqa: E501 - 'matched_object_array': 'matchedObjectArray', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.matched_object import MatchedObject +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class NormPartySearchResult(BaseModel): + """ + NormPartySearchResult + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=21, strict=True, max_length=21)]] = 'NormPartySearchResult' + norm_party_id: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=18)]] = Field(default=None, alias="normPartyId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + party_classification_type: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="partyClassificationType") + first_fetch_date: Optional[datetime] = Field(default=None, alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, alias="lastFetchDate") + norm_party_details_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="normPartyDetailsAPI") + matched_object_array: Optional[List[MatchedObject]] = Field(default=None, alias="matchedObjectArray") + __properties: ClassVar[List[str]] = ["object", "normPartyId", "name", "partyClassificationType", "firstFetchDate", "lastFetchDate", "normPartyDetailsAPI", "matchedObjectArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_party_id, name, party_classification_type, first_fetch_date, last_fetch_date, norm_party_details_api, matched_object_array, *args, **kwargs): # noqa: E501 - """NormPartySearchResult - a model defined in OpenAPI - - Args: - norm_party_id (str): - name (str): - party_classification_type (str): - first_fetch_date (datetime): - last_fetch_date (datetime): - norm_party_details_api (str): - matched_object_array ([MatchedObject]): - - Keyword Args: - object (str): defaults to "NormPartySearchResult" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "NormPartySearchResult") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NormPartySearchResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_party_id = norm_party_id - self.name = name - self.party_classification_type = party_classification_type - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.norm_party_details_api = norm_party_details_api - self.matched_object_array = matched_object_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_party_id, name, party_classification_type, first_fetch_date, last_fetch_date, norm_party_details_api, matched_object_array, *args, **kwargs): # noqa: E501 - """NormPartySearchResult - a model defined in OpenAPI - - Args: - norm_party_id (str): - name (str): - party_classification_type (str): - first_fetch_date (datetime): - last_fetch_date (datetime): - norm_party_details_api (str): - matched_object_array ([MatchedObject]): - - Keyword Args: - object (str): defaults to "NormPartySearchResult" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in matched_object_array (list) + _items = [] + if self.matched_object_array: + for _item in self.matched_object_array: + if _item: + _items.append(_item.to_dict()) + _dict['matchedObjectArray'] = _items + return _dict - object = kwargs.get('object', "NormPartySearchResult") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NormPartySearchResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'NormPartySearchResult', + "normPartyId": obj.get("normPartyId"), + "name": obj.get("name"), + "partyClassificationType": obj.get("partyClassificationType"), + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate"), + "normPartyDetailsAPI": obj.get("normPartyDetailsAPI"), + "matchedObjectArray": [MatchedObject.from_dict(_item) for _item in obj["matchedObjectArray"]] if obj.get("matchedObjectArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_party_id = norm_party_id - self.name = name - self.party_classification_type = party_classification_type - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.norm_party_details_api = norm_party_details_api - self.matched_object_array = matched_object_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/pacer_case_search_content.py b/unicourt/model/pacer_case_search_content.py index 60e6735..64e6647 100644 --- a/unicourt/model/pacer_case_search_content.py +++ b/unicourt/model/pacer_case_search_content.py @@ -1,638 +1,370 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations +import pprint import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class PACERCaseSearchContent(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PACERCaseSearchContent(BaseModel): """ + PACERCaseSearchContent + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=22, strict=True, max_length=22)]] = Field(default='PACERCaseSearchContent', description="Name of the object") + pcl_case_link: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to case in the case management/electronic case files (CM/ECF) system at the court.", alias="pclCaseLink") + pcl_jurisdiction_type: Optional[StrictStr] = Field(default=None, description="Link to case in the case management/electronic case files (CM/ECF) system at the court.", alias="pclJurisdictionType") + pcl_case_id: Optional[StrictInt] = Field(default=None, description="Sequentially generated number that identifies the case.", alias="pclCaseId") + pcl_case_number_full: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="Case Number.", alias="pclCaseNumberFull") + pcl_case_title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Title of the case.", alias="pclCaseTitle") + pcl_case_office: Optional[Annotated[str, Field(strict=True, max_length=2)]] = Field(default=None, description="The divisional office in which the case was filed.", alias="pclCaseOffice") + pcl_case_number: Optional[StrictInt] = Field(default=None, description="The sequence number of the case.", alias="pclCaseNumber") + pcl_case_type: Optional[Annotated[str, Field(strict=True, max_length=6)]] = Field(default=None, description="Code that identifies the type of case.", alias="pclCaseType") + pcl_case_year: Optional[StrictInt] = Field(default=None, description="The year in which the case falls. Could be two or four digit.", alias="pclCaseYear") + pcl_court_id: Optional[Annotated[str, Field(strict=True, max_length=6)]] = Field(default=None, description="The general geographical region or specific court district. The court ID is the abbreviation of the court location combined with the court type (dc or bk). Please refer the Appendix B", alias="pclCourtId") + pcl_date_filed: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="Filing date of the case.", alias="pclDateFiled") + pcl_jpml_number: Optional[StrictInt] = Field(default=None, description="JPML Case Seed number.", alias="pclJpmlNumber") + pcl_mdl_court_id: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="Which court does this mdl belongs too.", alias="pclMdlCourtId") + pcl_mdl_date_ordered: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the mdl date ordered of the case when it is present", alias="pclMdlDateOrdered") + pcl_mdl_date_received: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the mdl date received of the case when it is present", alias="pclMdlDateReceived") + pcl_mdl_extension: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the mdl extension of the case when it is present", alias="pclMdlExtension") + pcl_mdl_judge_last_name: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the mdl judge lastname of the case when it is present", alias="pclMdlJudgeLastName") + pcl_mdl_littype: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the mdl lit type of the case when it is present", alias="pclMdlLittype") + pcl_mdl_status: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the mdl status of the case when it is present", alias="pclMdlStatus") + pcl_mdl_transferee: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the mdl transferee of the case when it is present", alias="pclMdlTransferee") + pcl_mdl_transferee_district: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the mdl transferee district of the case when it is present", alias="pclMdlTransfereeDistrict") + pcl_civil_cto_number: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the civil cto number of the case when it is present", alias="pclCivilCtoNumber") + pcl_civil_date_disposition: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the civil disposition date of the case when it is present", alias="pclCivilDateDisposition") + pcl_civil_date_initiated: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the civil initiated date of the case when it is present", alias="pclCivilDateInitiated") + pcl_civil_date_terminated: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the civil terminated date of the case when it is present", alias="pclCivilDateTerminated") + pcl_civil_stat_disposition: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the civil stat disposition of the case when it is present", alias="pclCivilStatDisposition") + pcl_civil_stat_initiated: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the civil stat initiated of the case when it is present", alias="pclCivilStatInitiated") + pcl_civil_stat_terminated: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the civil stat terminated of the case when it is present", alias="pclCivilStatTerminated") + pcl_civil_transferee: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the civil transferee of the case when it is present", alias="pclCivilTransferee") + pcl_bankruptcy_chapter: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the bankruptcy chapter of the case when it is present", alias="pclBankruptcyChapter") + pcl_date_discharged: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the date discharged of the case when it is present", alias="pclDateDischarged") + pcl_date_dismissed: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the date dismissed of the case when it is present", alias="pclDateDismissed") + pcl_date_reopened: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the date reopened of the case when it is present", alias="pclDateReopened") + pcl_date_termed: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the date termed of the case when it is present", alias="pclDateTermed") + pcl_disposition: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="This parameter represents the disposition of the case when it is present", alias="pclDisposition") + pcl_disposition_method: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="This parameter represents the disposition method of the case when it is present", alias="pclDispositionMethod") + pcl_joint_bankruptcy_flag: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the joint bankruptcy flag of the case when it is present", alias="pclJointBankruptcyFlag") + pcl_joint_discharged_date: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the joint discharged date of the case when it is present", alias="pclJointDischargedDate") + pcl_joint_dismissed_date: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="This parameter represents the joint dismissed date of the case when it is present", alias="pclJointDismissedDate") + pcl_joint_disposition_method: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="This parameter represents the joint disposition method of the case when it is present", alias="pclJointDispositionMethod") + pcl_nature_of_suit: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the nature of suit of the case when it is present", alias="pclNatureOfSuit") + __properties: ClassVar[List[str]] = ["object", "pclCaseLink", "pclJurisdictionType", "pclCaseId", "pclCaseNumberFull", "pclCaseTitle", "pclCaseOffice", "pclCaseNumber", "pclCaseType", "pclCaseYear", "pclCourtId", "pclDateFiled", "pclJpmlNumber", "pclMdlCourtId", "pclMdlDateOrdered", "pclMdlDateReceived", "pclMdlExtension", "pclMdlJudgeLastName", "pclMdlLittype", "pclMdlStatus", "pclMdlTransferee", "pclMdlTransfereeDistrict", "pclCivilCtoNumber", "pclCivilDateDisposition", "pclCivilDateInitiated", "pclCivilDateTerminated", "pclCivilStatDisposition", "pclCivilStatInitiated", "pclCivilStatTerminated", "pclCivilTransferee", "pclBankruptcyChapter", "pclDateDischarged", "pclDateDismissed", "pclDateReopened", "pclDateTermed", "pclDisposition", "pclDispositionMethod", "pclJointBankruptcyFlag", "pclJointDischargedDate", "pclJointDismissedDate", "pclJointDispositionMethod", "pclNatureOfSuit"] + + @field_validator('pcl_jurisdiction_type') + def pcl_jurisdiction_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Appellate', 'Bankruptcy', 'Criminal', 'Civil', 'Multi-district Litigation', 'null']): + raise ValueError("must be one of enum values ('Appellate', 'Bankruptcy', 'Criminal', 'Civil', 'Multi-district Litigation', 'null')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('pcl_jurisdiction_type',): { - 'None': None, - 'APPELLATE': "Appellate", - 'BANKRUPTCY': "Bankruptcy", - 'CRIMINAL': "Criminal", - 'CIVIL': "Civil", - 'MULTI-DISTRICT_LITIGATION': "Multi-district Litigation", - 'NULL': "null", - }, - } - - validations = { - ('object',): { - 'max_length': 22, - 'min_length': 22, - }, - ('pcl_case_link',): { - 'max_length': 255, - }, - ('pcl_case_number_full',): { - 'max_length': 50, - }, - ('pcl_case_title',): { - 'max_length': 255, - }, - ('pcl_case_office',): { - 'max_length': 2, - }, - ('pcl_case_type',): { - 'max_length': 6, - }, - ('pcl_court_id',): { - 'max_length': 6, - }, - ('pcl_date_filed',): { - 'max_length': 10, - }, - ('pcl_mdl_court_id',): { - 'max_length': 10, - }, - ('pcl_mdl_date_ordered',): { - 'max_length': 10, - }, - ('pcl_mdl_date_received',): { - 'max_length': 10, - }, - ('pcl_mdl_extension',): { - 'max_length': 50, - }, - ('pcl_mdl_judge_last_name',): { - 'max_length': 50, - }, - ('pcl_mdl_littype',): { - 'max_length': 50, - }, - ('pcl_mdl_status',): { - 'max_length': 50, - }, - ('pcl_mdl_transferee',): { - 'max_length': 50, - }, - ('pcl_mdl_transferee_district',): { - 'max_length': 50, - }, - ('pcl_civil_cto_number',): { - 'max_length': 50, - }, - ('pcl_civil_date_disposition',): { - 'max_length': 10, - }, - ('pcl_civil_date_initiated',): { - 'max_length': 10, - }, - ('pcl_civil_date_terminated',): { - 'max_length': 10, - }, - ('pcl_civil_stat_disposition',): { - 'max_length': 50, - }, - ('pcl_civil_stat_initiated',): { - 'max_length': 50, - }, - ('pcl_civil_stat_terminated',): { - 'max_length': 50, - }, - ('pcl_civil_transferee',): { - 'max_length': 50, - }, - ('pcl_bankruptcy_chapter',): { - 'max_length': 50, - }, - ('pcl_date_discharged',): { - 'max_length': 10, - }, - ('pcl_date_dismissed',): { - 'max_length': 10, - }, - ('pcl_date_reopened',): { - 'max_length': 10, - }, - ('pcl_date_termed',): { - 'max_length': 10, - }, - ('pcl_disposition',): { - 'max_length': 100, - }, - ('pcl_disposition_method',): { - 'max_length': 100, - }, - ('pcl_joint_bankruptcy_flag',): { - 'max_length': 50, - }, - ('pcl_joint_discharged_date',): { - 'max_length': 10, - }, - ('pcl_joint_dismissed_date',): { - 'max_length': 10, - }, - ('pcl_joint_disposition_method',): { - 'max_length': 100, - }, - ('pcl_nature_of_suit',): { - 'max_length': 50, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PACERCaseSearchContent from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'pcl_case_link': (str, none_type,), # noqa: E501 - 'pcl_jurisdiction_type': (str, none_type,), # noqa: E501 - 'pcl_case_id': (int,), # noqa: E501 - 'pcl_case_number_full': (str, none_type,), # noqa: E501 - 'pcl_case_title': (str, none_type,), # noqa: E501 - 'pcl_case_office': (str, none_type,), # noqa: E501 - 'pcl_case_number': (int,), # noqa: E501 - 'pcl_case_type': (str, none_type,), # noqa: E501 - 'pcl_case_year': (int,), # noqa: E501 - 'pcl_court_id': (str, none_type,), # noqa: E501 - 'pcl_date_filed': (str, none_type,), # noqa: E501 - 'pcl_jpml_number': (int, none_type,), # noqa: E501 - 'pcl_mdl_court_id': (str, none_type,), # noqa: E501 - 'pcl_mdl_date_ordered': (str, none_type,), # noqa: E501 - 'pcl_mdl_date_received': (str, none_type,), # noqa: E501 - 'pcl_mdl_extension': (str, none_type,), # noqa: E501 - 'pcl_mdl_judge_last_name': (str, none_type,), # noqa: E501 - 'pcl_mdl_littype': (str, none_type,), # noqa: E501 - 'pcl_mdl_status': (str, none_type,), # noqa: E501 - 'pcl_mdl_transferee': (str, none_type,), # noqa: E501 - 'pcl_mdl_transferee_district': (str, none_type,), # noqa: E501 - 'pcl_civil_cto_number': (str, none_type,), # noqa: E501 - 'pcl_civil_date_disposition': (str, none_type,), # noqa: E501 - 'pcl_civil_date_initiated': (str, none_type,), # noqa: E501 - 'pcl_civil_date_terminated': (str, none_type,), # noqa: E501 - 'pcl_civil_stat_disposition': (str, none_type,), # noqa: E501 - 'pcl_civil_stat_initiated': (str, none_type,), # noqa: E501 - 'pcl_civil_stat_terminated': (str, none_type,), # noqa: E501 - 'pcl_civil_transferee': (str, none_type,), # noqa: E501 - 'pcl_bankruptcy_chapter': (str, none_type,), # noqa: E501 - 'pcl_date_discharged': (str, none_type,), # noqa: E501 - 'pcl_date_dismissed': (str, none_type,), # noqa: E501 - 'pcl_date_reopened': (str, none_type,), # noqa: E501 - 'pcl_date_termed': (str, none_type,), # noqa: E501 - 'pcl_disposition': (str, none_type,), # noqa: E501 - 'pcl_disposition_method': (str, none_type,), # noqa: E501 - 'pcl_joint_bankruptcy_flag': (str, none_type,), # noqa: E501 - 'pcl_joint_discharged_date': (str, none_type,), # noqa: E501 - 'pcl_joint_dismissed_date': (str, none_type,), # noqa: E501 - 'pcl_joint_disposition_method': (str, none_type,), # noqa: E501 - 'pcl_nature_of_suit': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'pcl_case_link': 'pclCaseLink', # noqa: E501 - 'pcl_jurisdiction_type': 'pclJurisdictionType', # noqa: E501 - 'pcl_case_id': 'pclCaseId', # noqa: E501 - 'pcl_case_number_full': 'pclCaseNumberFull', # noqa: E501 - 'pcl_case_title': 'pclCaseTitle', # noqa: E501 - 'pcl_case_office': 'pclCaseOffice', # noqa: E501 - 'pcl_case_number': 'pclCaseNumber', # noqa: E501 - 'pcl_case_type': 'pclCaseType', # noqa: E501 - 'pcl_case_year': 'pclCaseYear', # noqa: E501 - 'pcl_court_id': 'pclCourtId', # noqa: E501 - 'pcl_date_filed': 'pclDateFiled', # noqa: E501 - 'pcl_jpml_number': 'pclJpmlNumber', # noqa: E501 - 'pcl_mdl_court_id': 'pclMdlCourtId', # noqa: E501 - 'pcl_mdl_date_ordered': 'pclMdlDateOrdered', # noqa: E501 - 'pcl_mdl_date_received': 'pclMdlDateReceived', # noqa: E501 - 'pcl_mdl_extension': 'pclMdlExtension', # noqa: E501 - 'pcl_mdl_judge_last_name': 'pclMdlJudgeLastName', # noqa: E501 - 'pcl_mdl_littype': 'pclMdlLittype', # noqa: E501 - 'pcl_mdl_status': 'pclMdlStatus', # noqa: E501 - 'pcl_mdl_transferee': 'pclMdlTransferee', # noqa: E501 - 'pcl_mdl_transferee_district': 'pclMdlTransfereeDistrict', # noqa: E501 - 'pcl_civil_cto_number': 'pclCivilCtoNumber', # noqa: E501 - 'pcl_civil_date_disposition': 'pclCivilDateDisposition', # noqa: E501 - 'pcl_civil_date_initiated': 'pclCivilDateInitiated', # noqa: E501 - 'pcl_civil_date_terminated': 'pclCivilDateTerminated', # noqa: E501 - 'pcl_civil_stat_disposition': 'pclCivilStatDisposition', # noqa: E501 - 'pcl_civil_stat_initiated': 'pclCivilStatInitiated', # noqa: E501 - 'pcl_civil_stat_terminated': 'pclCivilStatTerminated', # noqa: E501 - 'pcl_civil_transferee': 'pclCivilTransferee', # noqa: E501 - 'pcl_bankruptcy_chapter': 'pclBankruptcyChapter', # noqa: E501 - 'pcl_date_discharged': 'pclDateDischarged', # noqa: E501 - 'pcl_date_dismissed': 'pclDateDismissed', # noqa: E501 - 'pcl_date_reopened': 'pclDateReopened', # noqa: E501 - 'pcl_date_termed': 'pclDateTermed', # noqa: E501 - 'pcl_disposition': 'pclDisposition', # noqa: E501 - 'pcl_disposition_method': 'pclDispositionMethod', # noqa: E501 - 'pcl_joint_bankruptcy_flag': 'pclJointBankruptcyFlag', # noqa: E501 - 'pcl_joint_discharged_date': 'pclJointDischargedDate', # noqa: E501 - 'pcl_joint_dismissed_date': 'pclJointDismissedDate', # noqa: E501 - 'pcl_joint_disposition_method': 'pclJointDispositionMethod', # noqa: E501 - 'pcl_nature_of_suit': 'pclNatureOfSuit', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if pcl_case_link (nullable) is None + # and model_fields_set contains the field + if self.pcl_case_link is None and "pcl_case_link" in self.model_fields_set: + _dict['pclCaseLink'] = None + + # set to None if pcl_jurisdiction_type (nullable) is None + # and model_fields_set contains the field + if self.pcl_jurisdiction_type is None and "pcl_jurisdiction_type" in self.model_fields_set: + _dict['pclJurisdictionType'] = None + + # set to None if pcl_case_number_full (nullable) is None + # and model_fields_set contains the field + if self.pcl_case_number_full is None and "pcl_case_number_full" in self.model_fields_set: + _dict['pclCaseNumberFull'] = None + + # set to None if pcl_case_title (nullable) is None + # and model_fields_set contains the field + if self.pcl_case_title is None and "pcl_case_title" in self.model_fields_set: + _dict['pclCaseTitle'] = None + + # set to None if pcl_case_office (nullable) is None + # and model_fields_set contains the field + if self.pcl_case_office is None and "pcl_case_office" in self.model_fields_set: + _dict['pclCaseOffice'] = None + + # set to None if pcl_case_type (nullable) is None + # and model_fields_set contains the field + if self.pcl_case_type is None and "pcl_case_type" in self.model_fields_set: + _dict['pclCaseType'] = None + + # set to None if pcl_court_id (nullable) is None + # and model_fields_set contains the field + if self.pcl_court_id is None and "pcl_court_id" in self.model_fields_set: + _dict['pclCourtId'] = None + + # set to None if pcl_date_filed (nullable) is None + # and model_fields_set contains the field + if self.pcl_date_filed is None and "pcl_date_filed" in self.model_fields_set: + _dict['pclDateFiled'] = None + + # set to None if pcl_jpml_number (nullable) is None + # and model_fields_set contains the field + if self.pcl_jpml_number is None and "pcl_jpml_number" in self.model_fields_set: + _dict['pclJpmlNumber'] = None + + # set to None if pcl_mdl_court_id (nullable) is None + # and model_fields_set contains the field + if self.pcl_mdl_court_id is None and "pcl_mdl_court_id" in self.model_fields_set: + _dict['pclMdlCourtId'] = None + + # set to None if pcl_mdl_date_ordered (nullable) is None + # and model_fields_set contains the field + if self.pcl_mdl_date_ordered is None and "pcl_mdl_date_ordered" in self.model_fields_set: + _dict['pclMdlDateOrdered'] = None + + # set to None if pcl_mdl_date_received (nullable) is None + # and model_fields_set contains the field + if self.pcl_mdl_date_received is None and "pcl_mdl_date_received" in self.model_fields_set: + _dict['pclMdlDateReceived'] = None + + # set to None if pcl_mdl_extension (nullable) is None + # and model_fields_set contains the field + if self.pcl_mdl_extension is None and "pcl_mdl_extension" in self.model_fields_set: + _dict['pclMdlExtension'] = None + + # set to None if pcl_mdl_judge_last_name (nullable) is None + # and model_fields_set contains the field + if self.pcl_mdl_judge_last_name is None and "pcl_mdl_judge_last_name" in self.model_fields_set: + _dict['pclMdlJudgeLastName'] = None + + # set to None if pcl_mdl_littype (nullable) is None + # and model_fields_set contains the field + if self.pcl_mdl_littype is None and "pcl_mdl_littype" in self.model_fields_set: + _dict['pclMdlLittype'] = None + + # set to None if pcl_mdl_status (nullable) is None + # and model_fields_set contains the field + if self.pcl_mdl_status is None and "pcl_mdl_status" in self.model_fields_set: + _dict['pclMdlStatus'] = None + + # set to None if pcl_mdl_transferee (nullable) is None + # and model_fields_set contains the field + if self.pcl_mdl_transferee is None and "pcl_mdl_transferee" in self.model_fields_set: + _dict['pclMdlTransferee'] = None + + # set to None if pcl_mdl_transferee_district (nullable) is None + # and model_fields_set contains the field + if self.pcl_mdl_transferee_district is None and "pcl_mdl_transferee_district" in self.model_fields_set: + _dict['pclMdlTransfereeDistrict'] = None + + # set to None if pcl_civil_cto_number (nullable) is None + # and model_fields_set contains the field + if self.pcl_civil_cto_number is None and "pcl_civil_cto_number" in self.model_fields_set: + _dict['pclCivilCtoNumber'] = None + + # set to None if pcl_civil_date_disposition (nullable) is None + # and model_fields_set contains the field + if self.pcl_civil_date_disposition is None and "pcl_civil_date_disposition" in self.model_fields_set: + _dict['pclCivilDateDisposition'] = None + + # set to None if pcl_civil_date_initiated (nullable) is None + # and model_fields_set contains the field + if self.pcl_civil_date_initiated is None and "pcl_civil_date_initiated" in self.model_fields_set: + _dict['pclCivilDateInitiated'] = None + + # set to None if pcl_civil_date_terminated (nullable) is None + # and model_fields_set contains the field + if self.pcl_civil_date_terminated is None and "pcl_civil_date_terminated" in self.model_fields_set: + _dict['pclCivilDateTerminated'] = None + + # set to None if pcl_civil_stat_disposition (nullable) is None + # and model_fields_set contains the field + if self.pcl_civil_stat_disposition is None and "pcl_civil_stat_disposition" in self.model_fields_set: + _dict['pclCivilStatDisposition'] = None + + # set to None if pcl_civil_stat_initiated (nullable) is None + # and model_fields_set contains the field + if self.pcl_civil_stat_initiated is None and "pcl_civil_stat_initiated" in self.model_fields_set: + _dict['pclCivilStatInitiated'] = None + + # set to None if pcl_civil_stat_terminated (nullable) is None + # and model_fields_set contains the field + if self.pcl_civil_stat_terminated is None and "pcl_civil_stat_terminated" in self.model_fields_set: + _dict['pclCivilStatTerminated'] = None + + # set to None if pcl_civil_transferee (nullable) is None + # and model_fields_set contains the field + if self.pcl_civil_transferee is None and "pcl_civil_transferee" in self.model_fields_set: + _dict['pclCivilTransferee'] = None + + # set to None if pcl_bankruptcy_chapter (nullable) is None + # and model_fields_set contains the field + if self.pcl_bankruptcy_chapter is None and "pcl_bankruptcy_chapter" in self.model_fields_set: + _dict['pclBankruptcyChapter'] = None + + # set to None if pcl_date_discharged (nullable) is None + # and model_fields_set contains the field + if self.pcl_date_discharged is None and "pcl_date_discharged" in self.model_fields_set: + _dict['pclDateDischarged'] = None + + # set to None if pcl_date_dismissed (nullable) is None + # and model_fields_set contains the field + if self.pcl_date_dismissed is None and "pcl_date_dismissed" in self.model_fields_set: + _dict['pclDateDismissed'] = None + + # set to None if pcl_date_reopened (nullable) is None + # and model_fields_set contains the field + if self.pcl_date_reopened is None and "pcl_date_reopened" in self.model_fields_set: + _dict['pclDateReopened'] = None + + # set to None if pcl_date_termed (nullable) is None + # and model_fields_set contains the field + if self.pcl_date_termed is None and "pcl_date_termed" in self.model_fields_set: + _dict['pclDateTermed'] = None + + # set to None if pcl_disposition (nullable) is None + # and model_fields_set contains the field + if self.pcl_disposition is None and "pcl_disposition" in self.model_fields_set: + _dict['pclDisposition'] = None + + # set to None if pcl_disposition_method (nullable) is None + # and model_fields_set contains the field + if self.pcl_disposition_method is None and "pcl_disposition_method" in self.model_fields_set: + _dict['pclDispositionMethod'] = None + + # set to None if pcl_joint_bankruptcy_flag (nullable) is None + # and model_fields_set contains the field + if self.pcl_joint_bankruptcy_flag is None and "pcl_joint_bankruptcy_flag" in self.model_fields_set: + _dict['pclJointBankruptcyFlag'] = None + + # set to None if pcl_joint_discharged_date (nullable) is None + # and model_fields_set contains the field + if self.pcl_joint_discharged_date is None and "pcl_joint_discharged_date" in self.model_fields_set: + _dict['pclJointDischargedDate'] = None + + # set to None if pcl_joint_dismissed_date (nullable) is None + # and model_fields_set contains the field + if self.pcl_joint_dismissed_date is None and "pcl_joint_dismissed_date" in self.model_fields_set: + _dict['pclJointDismissedDate'] = None + + # set to None if pcl_joint_disposition_method (nullable) is None + # and model_fields_set contains the field + if self.pcl_joint_disposition_method is None and "pcl_joint_disposition_method" in self.model_fields_set: + _dict['pclJointDispositionMethod'] = None + + # set to None if pcl_nature_of_suit (nullable) is None + # and model_fields_set contains the field + if self.pcl_nature_of_suit is None and "pcl_nature_of_suit" in self.model_fields_set: + _dict['pclNatureOfSuit'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pcl_case_link, pcl_jurisdiction_type, pcl_case_id, pcl_case_number_full, pcl_case_title, pcl_case_office, pcl_case_number, pcl_case_type, pcl_case_year, pcl_court_id, pcl_date_filed, pcl_jpml_number, pcl_mdl_court_id, pcl_mdl_date_ordered, pcl_mdl_date_received, pcl_mdl_extension, pcl_mdl_judge_last_name, pcl_mdl_littype, pcl_mdl_status, pcl_mdl_transferee, pcl_mdl_transferee_district, pcl_civil_cto_number, pcl_civil_date_disposition, pcl_civil_date_initiated, pcl_civil_date_terminated, pcl_civil_stat_disposition, pcl_civil_stat_initiated, pcl_civil_stat_terminated, pcl_civil_transferee, pcl_bankruptcy_chapter, pcl_date_discharged, pcl_date_dismissed, pcl_date_reopened, pcl_date_termed, pcl_disposition, pcl_disposition_method, pcl_joint_bankruptcy_flag, pcl_joint_discharged_date, pcl_joint_dismissed_date, pcl_joint_disposition_method, pcl_nature_of_suit, *args, **kwargs): # noqa: E501 - """PACERCaseSearchContent - a model defined in OpenAPI - - Args: - pcl_case_link (str, none_type): Link to case in the case management/electronic case files (CM/ECF) system at the court. - pcl_jurisdiction_type (str, none_type): Link to case in the case management/electronic case files (CM/ECF) system at the court. - pcl_case_id (int): Sequentially generated number that identifies the case. - pcl_case_number_full (str, none_type): Case Number. - pcl_case_title (str, none_type): Title of the case. - pcl_case_office (str, none_type): The divisional office in which the case was filed. - pcl_case_number (int): The sequence number of the case. - pcl_case_type (str, none_type): Code that identifies the type of case. - pcl_case_year (int): The year in which the case falls. Could be two or four digit. - pcl_court_id (str, none_type): The general geographical region or specific court district. The court ID is the abbreviation of the court location combined with the court type (dc or bk). Please refer the Appendix B - pcl_date_filed (str, none_type): Filing date of the case. - pcl_jpml_number (int, none_type): JPML Case Seed number. - pcl_mdl_court_id (str, none_type): Which court does this mdl belongs too. - pcl_mdl_date_ordered (str, none_type): This parameter represents the mdl date ordered of the case when it is present - pcl_mdl_date_received (str, none_type): This parameter represents the mdl date received of the case when it is present - pcl_mdl_extension (str, none_type): This parameter represents the mdl extension of the case when it is present - pcl_mdl_judge_last_name (str, none_type): This parameter represents the mdl judge lastname of the case when it is present - pcl_mdl_littype (str, none_type): This parameter represents the mdl lit type of the case when it is present - pcl_mdl_status (str, none_type): This parameter represents the mdl status of the case when it is present - pcl_mdl_transferee (str, none_type): This parameter represents the mdl transferee of the case when it is present - pcl_mdl_transferee_district (str, none_type): This parameter represents the mdl transferee district of the case when it is present - pcl_civil_cto_number (str, none_type): This parameter represents the civil cto number of the case when it is present - pcl_civil_date_disposition (str, none_type): This parameter represents the civil disposition date of the case when it is present - pcl_civil_date_initiated (str, none_type): This parameter represents the civil initiated date of the case when it is present - pcl_civil_date_terminated (str, none_type): This parameter represents the civil terminated date of the case when it is present - pcl_civil_stat_disposition (str, none_type): This parameter represents the civil stat disposition of the case when it is present - pcl_civil_stat_initiated (str, none_type): This parameter represents the civil stat initiated of the case when it is present - pcl_civil_stat_terminated (str, none_type): This parameter represents the civil stat terminated of the case when it is present - pcl_civil_transferee (str, none_type): This parameter represents the civil transferee of the case when it is present - pcl_bankruptcy_chapter (str, none_type): This parameter represents the bankruptcy chapter of the case when it is present - pcl_date_discharged (str, none_type): This parameter represents the date discharged of the case when it is present - pcl_date_dismissed (str, none_type): This parameter represents the date dismissed of the case when it is present - pcl_date_reopened (str, none_type): This parameter represents the date reopened of the case when it is present - pcl_date_termed (str, none_type): This parameter represents the date termed of the case when it is present - pcl_disposition (str, none_type): This parameter represents the disposition of the case when it is present - pcl_disposition_method (str, none_type): This parameter represents the disposition method of the case when it is present - pcl_joint_bankruptcy_flag (str, none_type): This parameter represents the joint bankruptcy flag of the case when it is present - pcl_joint_discharged_date (str, none_type): This parameter represents the joint discharged date of the case when it is present - pcl_joint_dismissed_date (str, none_type): This parameter represents the joint dismissed date of the case when it is present - pcl_joint_disposition_method (str, none_type): This parameter represents the joint disposition method of the case when it is present - pcl_nature_of_suit (str, none_type): This parameter represents the nature of suit of the case when it is present - - Keyword Args: - object (str): Name of the object. defaults to "PACERCaseSearchContent" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PACERCaseSearchContent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PACERCaseSearchContent', + "pclCaseLink": obj.get("pclCaseLink"), + "pclJurisdictionType": obj.get("pclJurisdictionType"), + "pclCaseId": obj.get("pclCaseId"), + "pclCaseNumberFull": obj.get("pclCaseNumberFull"), + "pclCaseTitle": obj.get("pclCaseTitle"), + "pclCaseOffice": obj.get("pclCaseOffice"), + "pclCaseNumber": obj.get("pclCaseNumber"), + "pclCaseType": obj.get("pclCaseType"), + "pclCaseYear": obj.get("pclCaseYear"), + "pclCourtId": obj.get("pclCourtId"), + "pclDateFiled": obj.get("pclDateFiled"), + "pclJpmlNumber": obj.get("pclJpmlNumber"), + "pclMdlCourtId": obj.get("pclMdlCourtId"), + "pclMdlDateOrdered": obj.get("pclMdlDateOrdered"), + "pclMdlDateReceived": obj.get("pclMdlDateReceived"), + "pclMdlExtension": obj.get("pclMdlExtension"), + "pclMdlJudgeLastName": obj.get("pclMdlJudgeLastName"), + "pclMdlLittype": obj.get("pclMdlLittype"), + "pclMdlStatus": obj.get("pclMdlStatus"), + "pclMdlTransferee": obj.get("pclMdlTransferee"), + "pclMdlTransfereeDistrict": obj.get("pclMdlTransfereeDistrict"), + "pclCivilCtoNumber": obj.get("pclCivilCtoNumber"), + "pclCivilDateDisposition": obj.get("pclCivilDateDisposition"), + "pclCivilDateInitiated": obj.get("pclCivilDateInitiated"), + "pclCivilDateTerminated": obj.get("pclCivilDateTerminated"), + "pclCivilStatDisposition": obj.get("pclCivilStatDisposition"), + "pclCivilStatInitiated": obj.get("pclCivilStatInitiated"), + "pclCivilStatTerminated": obj.get("pclCivilStatTerminated"), + "pclCivilTransferee": obj.get("pclCivilTransferee"), + "pclBankruptcyChapter": obj.get("pclBankruptcyChapter"), + "pclDateDischarged": obj.get("pclDateDischarged"), + "pclDateDismissed": obj.get("pclDateDismissed"), + "pclDateReopened": obj.get("pclDateReopened"), + "pclDateTermed": obj.get("pclDateTermed"), + "pclDisposition": obj.get("pclDisposition"), + "pclDispositionMethod": obj.get("pclDispositionMethod"), + "pclJointBankruptcyFlag": obj.get("pclJointBankruptcyFlag"), + "pclJointDischargedDate": obj.get("pclJointDischargedDate"), + "pclJointDismissedDate": obj.get("pclJointDismissedDate"), + "pclJointDispositionMethod": obj.get("pclJointDispositionMethod"), + "pclNatureOfSuit": obj.get("pclNatureOfSuit") + }) + return _obj - object = kwargs.get('object', "PACERCaseSearchContent") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.pcl_case_link = pcl_case_link - self.pcl_jurisdiction_type = pcl_jurisdiction_type - self.pcl_case_id = pcl_case_id - self.pcl_case_number_full = pcl_case_number_full - self.pcl_case_title = pcl_case_title - self.pcl_case_office = pcl_case_office - self.pcl_case_number = pcl_case_number - self.pcl_case_type = pcl_case_type - self.pcl_case_year = pcl_case_year - self.pcl_court_id = pcl_court_id - self.pcl_date_filed = pcl_date_filed - self.pcl_jpml_number = pcl_jpml_number - self.pcl_mdl_court_id = pcl_mdl_court_id - self.pcl_mdl_date_ordered = pcl_mdl_date_ordered - self.pcl_mdl_date_received = pcl_mdl_date_received - self.pcl_mdl_extension = pcl_mdl_extension - self.pcl_mdl_judge_last_name = pcl_mdl_judge_last_name - self.pcl_mdl_littype = pcl_mdl_littype - self.pcl_mdl_status = pcl_mdl_status - self.pcl_mdl_transferee = pcl_mdl_transferee - self.pcl_mdl_transferee_district = pcl_mdl_transferee_district - self.pcl_civil_cto_number = pcl_civil_cto_number - self.pcl_civil_date_disposition = pcl_civil_date_disposition - self.pcl_civil_date_initiated = pcl_civil_date_initiated - self.pcl_civil_date_terminated = pcl_civil_date_terminated - self.pcl_civil_stat_disposition = pcl_civil_stat_disposition - self.pcl_civil_stat_initiated = pcl_civil_stat_initiated - self.pcl_civil_stat_terminated = pcl_civil_stat_terminated - self.pcl_civil_transferee = pcl_civil_transferee - self.pcl_bankruptcy_chapter = pcl_bankruptcy_chapter - self.pcl_date_discharged = pcl_date_discharged - self.pcl_date_dismissed = pcl_date_dismissed - self.pcl_date_reopened = pcl_date_reopened - self.pcl_date_termed = pcl_date_termed - self.pcl_disposition = pcl_disposition - self.pcl_disposition_method = pcl_disposition_method - self.pcl_joint_bankruptcy_flag = pcl_joint_bankruptcy_flag - self.pcl_joint_discharged_date = pcl_joint_discharged_date - self.pcl_joint_dismissed_date = pcl_joint_dismissed_date - self.pcl_joint_disposition_method = pcl_joint_disposition_method - self.pcl_nature_of_suit = pcl_nature_of_suit - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, pcl_case_link, pcl_jurisdiction_type, pcl_case_id, pcl_case_number_full, pcl_case_title, pcl_case_office, pcl_case_number, pcl_case_type, pcl_case_year, pcl_court_id, pcl_date_filed, pcl_jpml_number, pcl_mdl_court_id, pcl_mdl_date_ordered, pcl_mdl_date_received, pcl_mdl_extension, pcl_mdl_judge_last_name, pcl_mdl_littype, pcl_mdl_status, pcl_mdl_transferee, pcl_mdl_transferee_district, pcl_civil_cto_number, pcl_civil_date_disposition, pcl_civil_date_initiated, pcl_civil_date_terminated, pcl_civil_stat_disposition, pcl_civil_stat_initiated, pcl_civil_stat_terminated, pcl_civil_transferee, pcl_bankruptcy_chapter, pcl_date_discharged, pcl_date_dismissed, pcl_date_reopened, pcl_date_termed, pcl_disposition, pcl_disposition_method, pcl_joint_bankruptcy_flag, pcl_joint_discharged_date, pcl_joint_dismissed_date, pcl_joint_disposition_method, pcl_nature_of_suit, *args, **kwargs): # noqa: E501 - """PACERCaseSearchContent - a model defined in OpenAPI - - Args: - pcl_case_link (str, none_type): Link to case in the case management/electronic case files (CM/ECF) system at the court. - pcl_jurisdiction_type (str, none_type): Link to case in the case management/electronic case files (CM/ECF) system at the court. - pcl_case_id (int): Sequentially generated number that identifies the case. - pcl_case_number_full (str, none_type): Case Number. - pcl_case_title (str, none_type): Title of the case. - pcl_case_office (str, none_type): The divisional office in which the case was filed. - pcl_case_number (int): The sequence number of the case. - pcl_case_type (str, none_type): Code that identifies the type of case. - pcl_case_year (int): The year in which the case falls. Could be two or four digit. - pcl_court_id (str, none_type): The general geographical region or specific court district. The court ID is the abbreviation of the court location combined with the court type (dc or bk). Please refer the Appendix B - pcl_date_filed (str, none_type): Filing date of the case. - pcl_jpml_number (int, none_type): JPML Case Seed number. - pcl_mdl_court_id (str, none_type): Which court does this mdl belongs too. - pcl_mdl_date_ordered (str, none_type): This parameter represents the mdl date ordered of the case when it is present - pcl_mdl_date_received (str, none_type): This parameter represents the mdl date received of the case when it is present - pcl_mdl_extension (str, none_type): This parameter represents the mdl extension of the case when it is present - pcl_mdl_judge_last_name (str, none_type): This parameter represents the mdl judge lastname of the case when it is present - pcl_mdl_littype (str, none_type): This parameter represents the mdl lit type of the case when it is present - pcl_mdl_status (str, none_type): This parameter represents the mdl status of the case when it is present - pcl_mdl_transferee (str, none_type): This parameter represents the mdl transferee of the case when it is present - pcl_mdl_transferee_district (str, none_type): This parameter represents the mdl transferee district of the case when it is present - pcl_civil_cto_number (str, none_type): This parameter represents the civil cto number of the case when it is present - pcl_civil_date_disposition (str, none_type): This parameter represents the civil disposition date of the case when it is present - pcl_civil_date_initiated (str, none_type): This parameter represents the civil initiated date of the case when it is present - pcl_civil_date_terminated (str, none_type): This parameter represents the civil terminated date of the case when it is present - pcl_civil_stat_disposition (str, none_type): This parameter represents the civil stat disposition of the case when it is present - pcl_civil_stat_initiated (str, none_type): This parameter represents the civil stat initiated of the case when it is present - pcl_civil_stat_terminated (str, none_type): This parameter represents the civil stat terminated of the case when it is present - pcl_civil_transferee (str, none_type): This parameter represents the civil transferee of the case when it is present - pcl_bankruptcy_chapter (str, none_type): This parameter represents the bankruptcy chapter of the case when it is present - pcl_date_discharged (str, none_type): This parameter represents the date discharged of the case when it is present - pcl_date_dismissed (str, none_type): This parameter represents the date dismissed of the case when it is present - pcl_date_reopened (str, none_type): This parameter represents the date reopened of the case when it is present - pcl_date_termed (str, none_type): This parameter represents the date termed of the case when it is present - pcl_disposition (str, none_type): This parameter represents the disposition of the case when it is present - pcl_disposition_method (str, none_type): This parameter represents the disposition method of the case when it is present - pcl_joint_bankruptcy_flag (str, none_type): This parameter represents the joint bankruptcy flag of the case when it is present - pcl_joint_discharged_date (str, none_type): This parameter represents the joint discharged date of the case when it is present - pcl_joint_dismissed_date (str, none_type): This parameter represents the joint dismissed date of the case when it is present - pcl_joint_disposition_method (str, none_type): This parameter represents the joint disposition method of the case when it is present - pcl_nature_of_suit (str, none_type): This parameter represents the nature of suit of the case when it is present - - Keyword Args: - object (str): Name of the object. defaults to "PACERCaseSearchContent" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - object = kwargs.get('object', "PACERCaseSearchContent") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.pcl_case_link = pcl_case_link - self.pcl_jurisdiction_type = pcl_jurisdiction_type - self.pcl_case_id = pcl_case_id - self.pcl_case_number_full = pcl_case_number_full - self.pcl_case_title = pcl_case_title - self.pcl_case_office = pcl_case_office - self.pcl_case_number = pcl_case_number - self.pcl_case_type = pcl_case_type - self.pcl_case_year = pcl_case_year - self.pcl_court_id = pcl_court_id - self.pcl_date_filed = pcl_date_filed - self.pcl_jpml_number = pcl_jpml_number - self.pcl_mdl_court_id = pcl_mdl_court_id - self.pcl_mdl_date_ordered = pcl_mdl_date_ordered - self.pcl_mdl_date_received = pcl_mdl_date_received - self.pcl_mdl_extension = pcl_mdl_extension - self.pcl_mdl_judge_last_name = pcl_mdl_judge_last_name - self.pcl_mdl_littype = pcl_mdl_littype - self.pcl_mdl_status = pcl_mdl_status - self.pcl_mdl_transferee = pcl_mdl_transferee - self.pcl_mdl_transferee_district = pcl_mdl_transferee_district - self.pcl_civil_cto_number = pcl_civil_cto_number - self.pcl_civil_date_disposition = pcl_civil_date_disposition - self.pcl_civil_date_initiated = pcl_civil_date_initiated - self.pcl_civil_date_terminated = pcl_civil_date_terminated - self.pcl_civil_stat_disposition = pcl_civil_stat_disposition - self.pcl_civil_stat_initiated = pcl_civil_stat_initiated - self.pcl_civil_stat_terminated = pcl_civil_stat_terminated - self.pcl_civil_transferee = pcl_civil_transferee - self.pcl_bankruptcy_chapter = pcl_bankruptcy_chapter - self.pcl_date_discharged = pcl_date_discharged - self.pcl_date_dismissed = pcl_date_dismissed - self.pcl_date_reopened = pcl_date_reopened - self.pcl_date_termed = pcl_date_termed - self.pcl_disposition = pcl_disposition - self.pcl_disposition_method = pcl_disposition_method - self.pcl_joint_bankruptcy_flag = pcl_joint_bankruptcy_flag - self.pcl_joint_discharged_date = pcl_joint_discharged_date - self.pcl_joint_dismissed_date = pcl_joint_dismissed_date - self.pcl_joint_disposition_method = pcl_joint_disposition_method - self.pcl_nature_of_suit = pcl_nature_of_suit - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/pacer_case_search_results.py b/unicourt/model/pacer_case_search_results.py index 85335af..fdcfeea 100644 --- a/unicourt/model/pacer_case_search_results.py +++ b/unicourt/model/pacer_case_search_results.py @@ -1,301 +1,102 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.case_search_result import CaseSearchResult - from unicourt.model.pacer_case_search_content import PACERCaseSearchContent - globals()['CaseSearchResult'] = CaseSearchResult - globals()['PACERCaseSearchContent'] = PACERCaseSearchContent +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class PACERCaseSearchResults(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_search_result import CaseSearchResult +from unicourt.model.pacer_case_search_content import PACERCaseSearchContent +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PACERCaseSearchResults(BaseModel): """ + PACERCaseSearchResults + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=22, strict=True, max_length=22)]] = Field(default='PACERCaseSearchResults', description="Name of the object") + pacer_content: Optional[PACERCaseSearchContent] = Field(default=None, alias="pacerContent") + has_only_meta_info: Optional[StrictBool] = Field(default=None, description="This field determines if the UniCourt Content has only meta information. If the value is true and you require to get the latest updates of the case you will need to make a request to the updateCase API.", alias="hasOnlyMetaInfo") + uni_court_content: Optional[CaseSearchResult] = Field(default=None, alias="uniCourtContent") + __properties: ClassVar[List[str]] = ["object", "pacerContent", "hasOnlyMetaInfo", "uniCourtContent"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 22, - 'min_length': 22, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PACERCaseSearchResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'pacer_content': (PACERCaseSearchContent,), # noqa: E501 - 'has_only_meta_info': (bool,), # noqa: E501 - 'uni_court_content': (CaseSearchResult,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'pacer_content': 'pacerContent', # noqa: E501 - 'has_only_meta_info': 'hasOnlyMetaInfo', # noqa: E501 - 'uni_court_content': 'uniCourtContent', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pacer_content + if self.pacer_content: + _dict['pacerContent'] = self.pacer_content.to_dict() + # override the default output from pydantic by calling `to_dict()` of uni_court_content + if self.uni_court_content: + _dict['uniCourtContent'] = self.uni_court_content.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pacer_content, has_only_meta_info, uni_court_content, *args, **kwargs): # noqa: E501 - """PACERCaseSearchResults - a model defined in OpenAPI - - Args: - pacer_content (PACERCaseSearchContent): - has_only_meta_info (bool): This field determines if the UniCourt Content has only meta information. If the value is true and you require to get the latest updates of the case you will need to make a request to the updateCase API. - uni_court_content (CaseSearchResult): - - Keyword Args: - object (str): Name of the object. defaults to "PACERCaseSearchResults" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PACERCaseSearchResults") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.pacer_content = pacer_content - self.has_only_meta_info = has_only_meta_info - self.uni_court_content = uni_court_content - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, pacer_content, has_only_meta_info, uni_court_content, *args, **kwargs): # noqa: E501 - """PACERCaseSearchResults - a model defined in OpenAPI - - Args: - pacer_content (PACERCaseSearchContent): - has_only_meta_info (bool): This field determines if the UniCourt Content has only meta information. If the value is true and you require to get the latest updates of the case you will need to make a request to the updateCase API. - uni_court_content (CaseSearchResult): - - Keyword Args: - object (str): Name of the object. defaults to "PACERCaseSearchResults" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PACERCaseSearchResults from a dict""" + if obj is None: + return None - object = kwargs.get('object', "PACERCaseSearchResults") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PACERCaseSearchResults', + "pacerContent": PACERCaseSearchContent.from_dict(obj["pacerContent"]) if obj.get("pacerContent") is not None else None, + "hasOnlyMetaInfo": obj.get("hasOnlyMetaInfo"), + "uniCourtContent": CaseSearchResult.from_dict(obj["uniCourtContent"]) if obj.get("uniCourtContent") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.pacer_content = pacer_content - self.has_only_meta_info = has_only_meta_info - self.uni_court_content = uni_court_content - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/pacer_credential.py b/unicourt/model/pacer_credential.py index c85ba7f..8099397 100644 --- a/unicourt/model/pacer_credential.py +++ b/unicourt/model/pacer_credential.py @@ -1,295 +1,107 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class PacerCredential(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PacerCredential(BaseModel): """ + PacerCredential + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=15, strict=True, max_length=15)]] = Field(default='PacerCredential', description="Name of the object.") + pacer_user_id: Optional[Annotated[str, Field(min_length=6, strict=True, max_length=40)]] = Field(default=None, description="Pacer User Id.", alias="pacerUserId") + default_pacer_client_code: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]] = Field(default=None, description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)", alias="defaultPacerClientCode") + __properties: ClassVar[List[str]] = ["object", "pacerUserId", "defaultPacerClientCode"] + + @field_validator('default_pacer_client_code') + def default_pacer_client_code_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9._\-\/]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9._\-\/]+$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 15, - 'min_length': 15, - }, - ('pacer_user_id',): { - 'max_length': 40, - 'min_length': 6, - }, - ('default_pacer_client_code',): { - 'max_length': 32, - 'min_length': 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PacerCredential from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'pacer_user_id': (str,), # noqa: E501 - 'default_pacer_client_code': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if default_pacer_client_code (nullable) is None + # and model_fields_set contains the field + if self.default_pacer_client_code is None and "default_pacer_client_code" in self.model_fields_set: + _dict['defaultPacerClientCode'] = None - attribute_map = { - 'object': 'object', # noqa: E501 - 'pacer_user_id': 'pacerUserId', # noqa: E501 - 'default_pacer_client_code': 'defaultPacerClientCode', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pacer_user_id, default_pacer_client_code, *args, **kwargs): # noqa: E501 - """PacerCredential - a model defined in OpenAPI - - Args: - pacer_user_id (str): Pacer User Id. - default_pacer_client_code (str, none_type): Pacer Client Code. - - Keyword Args: - object (str): Name of the object.. defaults to "PacerCredential" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PacerCredential") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.pacer_user_id = pacer_user_id - self.default_pacer_client_code = default_pacer_client_code - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, pacer_user_id, default_pacer_client_code, *args, **kwargs): # noqa: E501 - """PacerCredential - a model defined in OpenAPI - - Args: - pacer_user_id (str): Pacer User Id. - default_pacer_client_code (str, none_type): Pacer Client Code. - - Keyword Args: - object (str): Name of the object.. defaults to "PacerCredential" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PacerCredential from a dict""" + if obj is None: + return None - object = kwargs.get('object', "PacerCredential") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PacerCredential', + "pacerUserId": obj.get("pacerUserId"), + "defaultPacerClientCode": obj.get("defaultPacerClientCode") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.pacer_user_id = pacer_user_id - self.default_pacer_client_code = default_pacer_client_code - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/pacer_credential_list_response.py b/unicourt/model/pacer_credential_list_response.py index abe70fd..588b949 100644 --- a/unicourt/model/pacer_credential_list_response.py +++ b/unicourt/model/pacer_credential_list_response.py @@ -1,329 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.pacer_credential import PacerCredential - globals()['PacerCredential'] = PacerCredential - - -class PacerCredentialListResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 27, - 'min_length': 27, - }, - ('next_page_api',): { - 'max_length': 1024, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 1024, - 'min_length': 1, - }, - ('pacer_credential_array',): { - 'max_items': 100, - 'min_items': 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'pacer_credential_array': ([PacerCredential],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'pacer_credential_array': 'pacerCredentialArray', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.pacer_credential import PacerCredential +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class PacerCredentialListResponse(BaseModel): + """ + PacerCredentialListResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=27, strict=True, max_length=27)]] = Field(default='PacerCredentialListResponse', description="Name of the object.") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages available.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of pacer credentials available.", alias="totalCount") + page_number: Optional[StrictInt] = Field(default=None, description="Current page number.", alias="pageNumber") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field(default=None, description="Link for the next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = Field(default=None, description="Link for the previous page.", alias="previousPageAPI") + pacer_credential_array: Optional[Annotated[List[PacerCredential], Field(min_length=0, max_length=100)]] = Field(default=None, description="Array of pacer credentials.", alias="pacerCredentialArray") + __properties: ClassVar[List[str]] = ["object", "totalPages", "totalCount", "pageNumber", "nextPageAPI", "previousPageAPI", "pacerCredentialArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, total_pages, total_count, page_number, next_page_api, previous_page_api, pacer_credential_array, *args, **kwargs): # noqa: E501 - """PacerCredentialListResponse - a model defined in OpenAPI - - Args: - total_pages (int): Total number of pages available. - total_count (int): Total number of pacer credentials available. - page_number (int): Current page number. - next_page_api (str, none_type): Link for the next page. - previous_page_api (str, none_type): Link for the previous page. - pacer_credential_array ([PacerCredential]): Array of pacer credentials. - - Keyword Args: - object (str): Name of the object.. defaults to "PacerCredentialListResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PacerCredentialListResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PacerCredentialListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.total_pages = total_pages - self.total_count = total_count - self.page_number = page_number - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.pacer_credential_array = pacer_credential_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, total_pages, total_count, page_number, next_page_api, previous_page_api, pacer_credential_array, *args, **kwargs): # noqa: E501 - """PacerCredentialListResponse - a model defined in OpenAPI - - Args: - total_pages (int): Total number of pages available. - total_count (int): Total number of pacer credentials available. - page_number (int): Current page number. - next_page_api (str, none_type): Link for the next page. - previous_page_api (str, none_type): Link for the previous page. - pacer_credential_array ([PacerCredential]): Array of pacer credentials. - - Keyword Args: - object (str): Name of the object.. defaults to "PacerCredentialListResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in pacer_credential_array (list) + _items = [] + if self.pacer_credential_array: + for _item in self.pacer_credential_array: + if _item: + _items.append(_item.to_dict()) + _dict['pacerCredentialArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "PacerCredentialListResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PacerCredentialListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PacerCredentialListResponse', + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount"), + "pageNumber": obj.get("pageNumber"), + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pacerCredentialArray": [PacerCredential.from_dict(_item) for _item in obj["pacerCredentialArray"]] if obj.get("pacerCredentialArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.total_pages = total_pages - self.total_count = total_count - self.page_number = page_number - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.pacer_credential_array = pacer_credential_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/pacer_credential_request.py b/unicourt/model/pacer_credential_request.py index 76fad26..bb07ef8 100644 --- a/unicourt/model/pacer_credential_request.py +++ b/unicourt/model/pacer_credential_request.py @@ -1,291 +1,107 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class PacerCredentialRequest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PacerCredentialRequest(BaseModel): """ + PacerCredentialRequest + """ # noqa: E501 + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40)] = Field(description="Pacer User Id.", alias="pacerUserId") + default_pacer_client_code: Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]] = Field(default=None, description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)", alias="defaultPacerClientCode") + password: Annotated[str, Field(min_length=8, strict=True, max_length=45)] = Field(description="Password.") + __properties: ClassVar[List[str]] = ["pacerUserId", "defaultPacerClientCode", "password"] + + @field_validator('default_pacer_client_code') + def default_pacer_client_code_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[a-zA-Z0-9._\-\/]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9._\-\/]+$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('pacer_user_id',): { - 'max_length': 40, - 'min_length': 6, - }, - ('password',): { - 'max_length': 45, - 'min_length': 8, - }, - ('default_pacer_client_code',): { - 'max_length': 32, - 'min_length': 0, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PacerCredentialRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'pacer_user_id': (str,), # noqa: E501 - 'password': (str,), # noqa: E501 - 'default_pacer_client_code': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if default_pacer_client_code (nullable) is None + # and model_fields_set contains the field + if self.default_pacer_client_code is None and "default_pacer_client_code" in self.model_fields_set: + _dict['defaultPacerClientCode'] = None - attribute_map = { - 'pacer_user_id': 'pacerUserId', # noqa: E501 - 'password': 'password', # noqa: E501 - 'default_pacer_client_code': 'defaultPacerClientCode', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pacer_user_id, password, *args, **kwargs): # noqa: E501 - """PacerCredentialRequest - a model defined in OpenAPI - - Args: - pacer_user_id (str): Pacer User Id. - password (str): Password. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - default_pacer_client_code (str, none_type): Pacer Client Code.. [optional] # noqa: E501 - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.pacer_user_id = pacer_user_id - self.password = password - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, pacer_user_id, password, *args, **kwargs): # noqa: E501 - """PacerCredentialRequest - a model defined in OpenAPI - - Args: - pacer_user_id (str): Pacer User Id. - password (str): Password. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - default_pacer_client_code (str, none_type): Pacer Client Code.. [optional] # noqa: E501 - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PacerCredentialRequest from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "pacerUserId": obj.get("pacerUserId"), + "defaultPacerClientCode": obj.get("defaultPacerClientCode"), + "password": obj.get("password") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.pacer_user_id = pacer_user_id - self.password = password - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/pacer_import_case.py b/unicourt/model/pacer_import_case.py index 60194a7..f1099bf 100644 --- a/unicourt/model/pacer_import_case.py +++ b/unicourt/model/pacer_import_case.py @@ -1,293 +1,105 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.pacer_import_case_results import PACERImportCaseResults - globals()['PACERImportCaseResults'] = PACERImportCaseResults - - -class PACERImportCase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 15, - 'min_length': 15, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'court_fee': (float, none_type,), # noqa: E501 - 'pacer_import_case_results_array': ([PACERImportCaseResults],), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from unicourt.model.pacer_import_case_results import PACERImportCaseResults +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class PACERImportCase(BaseModel): + """ + PACERImportCase + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=15, strict=True, max_length=15)]] = Field(default='PACERImportCase', description="Name of the object") + court_fee: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Court Fee charged for the Find Case request. This is only applicable for Appeal Cases.", alias="courtFee") + pacer_import_case_results_array: Optional[List[PACERImportCaseResults]] = Field(default=None, alias="pacerImportCaseResultsArray") + __properties: ClassVar[List[str]] = ["object", "courtFee", "pacerImportCaseResultsArray"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'object': 'object', # noqa: E501 - 'court_fee': 'courtFee', # noqa: E501 - 'pacer_import_case_results_array': 'pacerImportCaseResultsArray', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, court_fee, pacer_import_case_results_array, *args, **kwargs): # noqa: E501 - """PACERImportCase - a model defined in OpenAPI - - Args: - court_fee (float, none_type): Court Fee charged for the Find Case request. This is only applicable for Appeal Cases. - pacer_import_case_results_array ([PACERImportCaseResults]): - - Keyword Args: - object (str): Name of the object. defaults to "PACERImportCase" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PACERImportCase from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "PACERImportCase") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.court_fee = court_fee - self.pacer_import_case_results_array = pacer_import_case_results_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, court_fee, pacer_import_case_results_array, *args, **kwargs): # noqa: E501 - """PACERImportCase - a model defined in OpenAPI - - Args: - court_fee (float, none_type): Court Fee charged for the Find Case request. This is only applicable for Appeal Cases. - pacer_import_case_results_array ([PACERImportCaseResults]): - - Keyword Args: - object (str): Name of the object. defaults to "PACERImportCase" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in pacer_import_case_results_array (list) + _items = [] + if self.pacer_import_case_results_array: + for _item in self.pacer_import_case_results_array: + if _item: + _items.append(_item.to_dict()) + _dict['pacerImportCaseResultsArray'] = _items + # set to None if court_fee (nullable) is None + # and model_fields_set contains the field + if self.court_fee is None and "court_fee" in self.model_fields_set: + _dict['courtFee'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PACERImportCase from a dict""" + if obj is None: + return None - object = kwargs.get('object', "PACERImportCase") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PACERImportCase', + "courtFee": obj.get("courtFee"), + "pacerImportCaseResultsArray": [PACERImportCaseResults.from_dict(_item) for _item in obj["pacerImportCaseResultsArray"]] if obj.get("pacerImportCaseResultsArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.court_fee = court_fee - self.pacer_import_case_results_array = pacer_import_case_results_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/pacer_import_case_results.py b/unicourt/model/pacer_import_case_results.py index 4f75ee6..f81d763 100644 --- a/unicourt/model/pacer_import_case_results.py +++ b/unicourt/model/pacer_import_case_results.py @@ -1,293 +1,96 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_search_result import CaseSearchResult - globals()['CaseSearchResult'] = CaseSearchResult - - -class PACERImportCaseResults(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 22, - 'min_length': 22, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'has_only_meta_info': (bool,), # noqa: E501 - 'uni_court_content': (CaseSearchResult,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_search_result import CaseSearchResult +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class PACERImportCaseResults(BaseModel): + """ + PACERImportCaseResults + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=22, strict=True, max_length=22)]] = Field(default='PACERImportCaseResults', description="Name of the object") + has_only_meta_info: Optional[StrictBool] = Field(default=None, description="This field determines if the UniCourt Content has only meta information. If the value is true and you require to get the latest updates of the case you will need to make a request to the updateCase API.", alias="hasOnlyMetaInfo") + uni_court_content: Optional[CaseSearchResult] = Field(default=None, alias="uniCourtContent") + __properties: ClassVar[List[str]] = ["object", "hasOnlyMetaInfo", "uniCourtContent"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'object': 'object', # noqa: E501 - 'has_only_meta_info': 'hasOnlyMetaInfo', # noqa: E501 - 'uni_court_content': 'uniCourtContent', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, has_only_meta_info, uni_court_content, *args, **kwargs): # noqa: E501 - """PACERImportCaseResults - a model defined in OpenAPI - - Args: - has_only_meta_info (bool): This field determines if the UniCourt Content has only meta information. If the value is true and you require to get the latest updates of the case you will need to make a request to the updateCase API. - uni_court_content (CaseSearchResult): - - Keyword Args: - object (str): Name of the object. defaults to "PACERImportCaseResults" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PACERImportCaseResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "PACERImportCaseResults") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.has_only_meta_info = has_only_meta_info - self.uni_court_content = uni_court_content - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, has_only_meta_info, uni_court_content, *args, **kwargs): # noqa: E501 - """PACERImportCaseResults - a model defined in OpenAPI - - Args: - has_only_meta_info (bool): This field determines if the UniCourt Content has only meta information. If the value is true and you require to get the latest updates of the case you will need to make a request to the updateCase API. - uni_court_content (CaseSearchResult): - - Keyword Args: - object (str): Name of the object. defaults to "PACERImportCaseResults" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of uni_court_content + if self.uni_court_content: + _dict['uniCourtContent'] = self.uni_court_content.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PACERImportCaseResults from a dict""" + if obj is None: + return None - object = kwargs.get('object', "PACERImportCaseResults") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PACERImportCaseResults', + "hasOnlyMetaInfo": obj.get("hasOnlyMetaInfo"), + "uniCourtContent": CaseSearchResult.from_dict(obj["uniCourtContent"]) if obj.get("uniCourtContent") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.has_only_meta_info = has_only_meta_info - self.uni_court_content = uni_court_content - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/pacer_party_search_content.py b/unicourt/model/pacer_party_search_content.py index 4e3a6de..7a77865 100644 --- a/unicourt/model/pacer_party_search_content.py +++ b/unicourt/model/pacer_party_search_content.py @@ -1,428 +1,201 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations +import pprint import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.pacer_case_search_content import PACERCaseSearchContent - globals()['PACERCaseSearchContent'] = PACERCaseSearchContent - - -class PACERPartySearchContent(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.pacer_case_search_content import PACERCaseSearchContent +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PACERPartySearchContent(BaseModel): """ + PACERPartySearchContent + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=23, strict=True, max_length=23)]] = Field(default='PACERPartySearchContent', description="Name of the object") + pcl_jurisdiction_type: Optional[StrictStr] = Field(default=None, description="Link to case in the case management/electronic case files (CM/ECF) system at the court.", alias="pclJurisdictionType") + pcl_case_id: Optional[StrictInt] = Field(default=None, description="Sequentially generated number that identifies the case.", alias="pclCaseId") + pcl_case_number_full: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="Case Number.", alias="pclCaseNumberFull") + pcl_case_title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Title of the case.", alias="pclCaseTitle") + pcl_case_office: Optional[Annotated[str, Field(strict=True, max_length=2)]] = Field(default=None, description="The divisional office in which the case was filed.", alias="pclCaseOffice") + pcl_case_number: Optional[StrictInt] = Field(default=None, description="The sequence number of the case.", alias="pclCaseNumber") + pcl_case_type: Optional[Annotated[str, Field(strict=True, max_length=6)]] = Field(default=None, description="Code that identifies the type of case.", alias="pclCaseType") + pcl_case_year: Optional[StrictInt] = Field(default=None, description="The year in which the case falls. Could be two or four digit.", alias="pclCaseYear") + pcl_court_id: Optional[Annotated[str, Field(strict=True, max_length=6)]] = Field(default=None, description="The general geographical region or specific court district. The court ID is the abbreviation of the court location combined with the court type (dc or bk). Please refer the Appendix B", alias="pclCourtId") + pcl_date_filed: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, description="Filing date of the case.", alias="pclDateFiled") + pcl_last_name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="This parameter represents the last name of the case when it is present", alias="pclLastName") + pcl_first_name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="This parameter represents the first name of the case when it is present", alias="pclFirstName") + pcl_middle_name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="This parameter represents the middle name of the case when it is present", alias="pclMiddleName") + pcl_generation: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the generation of the case when it is present", alias="pclGeneration") + pcl_party_role: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the party role of the case when it is present", alias="pclPartyRole") + pcl_party_type: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="This parameter represents the party type of the case when it is present", alias="pclPartyType") + pcl_court_case: Optional[PACERCaseSearchContent] = Field(default=None, alias="pclCourtCase") + __properties: ClassVar[List[str]] = ["object", "pclJurisdictionType", "pclCaseId", "pclCaseNumberFull", "pclCaseTitle", "pclCaseOffice", "pclCaseNumber", "pclCaseType", "pclCaseYear", "pclCourtId", "pclDateFiled", "pclLastName", "pclFirstName", "pclMiddleName", "pclGeneration", "pclPartyRole", "pclPartyType", "pclCourtCase"] + + @field_validator('pcl_jurisdiction_type') + def pcl_jurisdiction_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Appellate', 'Bankruptcy', 'Criminal', 'Civil', 'Multi-district Litigation', 'null']): + raise ValueError("must be one of enum values ('Appellate', 'Bankruptcy', 'Criminal', 'Civil', 'Multi-district Litigation', 'null')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('pcl_jurisdiction_type',): { - 'None': None, - 'APPELLATE': "Appellate", - 'BANKRUPTCY': "Bankruptcy", - 'CRIMINAL': "Criminal", - 'CIVIL': "Civil", - 'MULTI-DISTRICT_LITIGATION': "Multi-district Litigation", - 'NULL': "null", - }, - } - - validations = { - ('object',): { - 'max_length': 23, - 'min_length': 23, - }, - ('pcl_case_number_full',): { - 'max_length': 50, - }, - ('pcl_case_title',): { - 'max_length': 255, - }, - ('pcl_case_office',): { - 'max_length': 2, - }, - ('pcl_case_type',): { - 'max_length': 6, - }, - ('pcl_court_id',): { - 'max_length': 6, - }, - ('pcl_date_filed',): { - 'max_length': 10, - }, - ('pcl_last_name',): { - 'max_length': 255, - }, - ('pcl_first_name',): { - 'max_length': 255, - }, - ('pcl_middle_name',): { - 'max_length': 255, - }, - ('pcl_generation',): { - 'max_length': 50, - }, - ('pcl_party_role',): { - 'max_length': 50, - }, - ('pcl_party_type',): { - 'max_length': 50, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PACERPartySearchContent from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'pcl_jurisdiction_type': (str, none_type,), # noqa: E501 - 'pcl_case_id': (int,), # noqa: E501 - 'pcl_case_number_full': (str, none_type,), # noqa: E501 - 'pcl_case_title': (str, none_type,), # noqa: E501 - 'pcl_case_office': (str, none_type,), # noqa: E501 - 'pcl_case_number': (int,), # noqa: E501 - 'pcl_case_type': (str, none_type,), # noqa: E501 - 'pcl_case_year': (int,), # noqa: E501 - 'pcl_court_id': (str, none_type,), # noqa: E501 - 'pcl_date_filed': (str, none_type,), # noqa: E501 - 'pcl_last_name': (str, none_type,), # noqa: E501 - 'pcl_first_name': (str, none_type,), # noqa: E501 - 'pcl_middle_name': (str, none_type,), # noqa: E501 - 'pcl_generation': (str, none_type,), # noqa: E501 - 'pcl_party_role': (str, none_type,), # noqa: E501 - 'pcl_party_type': (str, none_type,), # noqa: E501 - 'pcl_court_case': (PACERCaseSearchContent,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'pcl_jurisdiction_type': 'pclJurisdictionType', # noqa: E501 - 'pcl_case_id': 'pclCaseId', # noqa: E501 - 'pcl_case_number_full': 'pclCaseNumberFull', # noqa: E501 - 'pcl_case_title': 'pclCaseTitle', # noqa: E501 - 'pcl_case_office': 'pclCaseOffice', # noqa: E501 - 'pcl_case_number': 'pclCaseNumber', # noqa: E501 - 'pcl_case_type': 'pclCaseType', # noqa: E501 - 'pcl_case_year': 'pclCaseYear', # noqa: E501 - 'pcl_court_id': 'pclCourtId', # noqa: E501 - 'pcl_date_filed': 'pclDateFiled', # noqa: E501 - 'pcl_last_name': 'pclLastName', # noqa: E501 - 'pcl_first_name': 'pclFirstName', # noqa: E501 - 'pcl_middle_name': 'pclMiddleName', # noqa: E501 - 'pcl_generation': 'pclGeneration', # noqa: E501 - 'pcl_party_role': 'pclPartyRole', # noqa: E501 - 'pcl_party_type': 'pclPartyType', # noqa: E501 - 'pcl_court_case': 'pclCourtCase', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pcl_court_case + if self.pcl_court_case: + _dict['pclCourtCase'] = self.pcl_court_case.to_dict() + # set to None if pcl_jurisdiction_type (nullable) is None + # and model_fields_set contains the field + if self.pcl_jurisdiction_type is None and "pcl_jurisdiction_type" in self.model_fields_set: + _dict['pclJurisdictionType'] = None + + # set to None if pcl_case_number_full (nullable) is None + # and model_fields_set contains the field + if self.pcl_case_number_full is None and "pcl_case_number_full" in self.model_fields_set: + _dict['pclCaseNumberFull'] = None + + # set to None if pcl_case_title (nullable) is None + # and model_fields_set contains the field + if self.pcl_case_title is None and "pcl_case_title" in self.model_fields_set: + _dict['pclCaseTitle'] = None + + # set to None if pcl_case_office (nullable) is None + # and model_fields_set contains the field + if self.pcl_case_office is None and "pcl_case_office" in self.model_fields_set: + _dict['pclCaseOffice'] = None + + # set to None if pcl_case_type (nullable) is None + # and model_fields_set contains the field + if self.pcl_case_type is None and "pcl_case_type" in self.model_fields_set: + _dict['pclCaseType'] = None + + # set to None if pcl_court_id (nullable) is None + # and model_fields_set contains the field + if self.pcl_court_id is None and "pcl_court_id" in self.model_fields_set: + _dict['pclCourtId'] = None + + # set to None if pcl_date_filed (nullable) is None + # and model_fields_set contains the field + if self.pcl_date_filed is None and "pcl_date_filed" in self.model_fields_set: + _dict['pclDateFiled'] = None + + # set to None if pcl_last_name (nullable) is None + # and model_fields_set contains the field + if self.pcl_last_name is None and "pcl_last_name" in self.model_fields_set: + _dict['pclLastName'] = None + + # set to None if pcl_first_name (nullable) is None + # and model_fields_set contains the field + if self.pcl_first_name is None and "pcl_first_name" in self.model_fields_set: + _dict['pclFirstName'] = None + + # set to None if pcl_middle_name (nullable) is None + # and model_fields_set contains the field + if self.pcl_middle_name is None and "pcl_middle_name" in self.model_fields_set: + _dict['pclMiddleName'] = None + + # set to None if pcl_generation (nullable) is None + # and model_fields_set contains the field + if self.pcl_generation is None and "pcl_generation" in self.model_fields_set: + _dict['pclGeneration'] = None + + # set to None if pcl_party_role (nullable) is None + # and model_fields_set contains the field + if self.pcl_party_role is None and "pcl_party_role" in self.model_fields_set: + _dict['pclPartyRole'] = None + + # set to None if pcl_party_type (nullable) is None + # and model_fields_set contains the field + if self.pcl_party_type is None and "pcl_party_type" in self.model_fields_set: + _dict['pclPartyType'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pcl_jurisdiction_type, pcl_case_id, pcl_case_number_full, pcl_case_title, pcl_case_office, pcl_case_number, pcl_case_type, pcl_case_year, pcl_court_id, pcl_date_filed, pcl_last_name, pcl_first_name, pcl_middle_name, pcl_generation, pcl_party_role, pcl_party_type, pcl_court_case, *args, **kwargs): # noqa: E501 - """PACERPartySearchContent - a model defined in OpenAPI - - Args: - pcl_jurisdiction_type (str, none_type): Link to case in the case management/electronic case files (CM/ECF) system at the court. - pcl_case_id (int): Sequentially generated number that identifies the case. - pcl_case_number_full (str, none_type): Case Number. - pcl_case_title (str, none_type): Title of the case. - pcl_case_office (str, none_type): The divisional office in which the case was filed. - pcl_case_number (int): The sequence number of the case. - pcl_case_type (str, none_type): Code that identifies the type of case. - pcl_case_year (int): The year in which the case falls. Could be two or four digit. - pcl_court_id (str, none_type): The general geographical region or specific court district. The court ID is the abbreviation of the court location combined with the court type (dc or bk). Please refer the Appendix B - pcl_date_filed (str, none_type): Filing date of the case. - pcl_last_name (str, none_type): This parameter represents the last name of the case when it is present - pcl_first_name (str, none_type): This parameter represents the first name of the case when it is present - pcl_middle_name (str, none_type): This parameter represents the middle name of the case when it is present - pcl_generation (str, none_type): This parameter represents the generation of the case when it is present - pcl_party_role (str, none_type): This parameter represents the party role of the case when it is present - pcl_party_type (str, none_type): This parameter represents the party type of the case when it is present - pcl_court_case (PACERCaseSearchContent): - - Keyword Args: - object (str): Name of the object. defaults to "PACERPartySearchContent" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PACERPartySearchContent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PACERPartySearchContent', + "pclJurisdictionType": obj.get("pclJurisdictionType"), + "pclCaseId": obj.get("pclCaseId"), + "pclCaseNumberFull": obj.get("pclCaseNumberFull"), + "pclCaseTitle": obj.get("pclCaseTitle"), + "pclCaseOffice": obj.get("pclCaseOffice"), + "pclCaseNumber": obj.get("pclCaseNumber"), + "pclCaseType": obj.get("pclCaseType"), + "pclCaseYear": obj.get("pclCaseYear"), + "pclCourtId": obj.get("pclCourtId"), + "pclDateFiled": obj.get("pclDateFiled"), + "pclLastName": obj.get("pclLastName"), + "pclFirstName": obj.get("pclFirstName"), + "pclMiddleName": obj.get("pclMiddleName"), + "pclGeneration": obj.get("pclGeneration"), + "pclPartyRole": obj.get("pclPartyRole"), + "pclPartyType": obj.get("pclPartyType"), + "pclCourtCase": PACERCaseSearchContent.from_dict(obj["pclCourtCase"]) if obj.get("pclCourtCase") is not None else None + }) + return _obj - object = kwargs.get('object', "PACERPartySearchContent") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.pcl_jurisdiction_type = pcl_jurisdiction_type - self.pcl_case_id = pcl_case_id - self.pcl_case_number_full = pcl_case_number_full - self.pcl_case_title = pcl_case_title - self.pcl_case_office = pcl_case_office - self.pcl_case_number = pcl_case_number - self.pcl_case_type = pcl_case_type - self.pcl_case_year = pcl_case_year - self.pcl_court_id = pcl_court_id - self.pcl_date_filed = pcl_date_filed - self.pcl_last_name = pcl_last_name - self.pcl_first_name = pcl_first_name - self.pcl_middle_name = pcl_middle_name - self.pcl_generation = pcl_generation - self.pcl_party_role = pcl_party_role - self.pcl_party_type = pcl_party_type - self.pcl_court_case = pcl_court_case - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, pcl_jurisdiction_type, pcl_case_id, pcl_case_number_full, pcl_case_title, pcl_case_office, pcl_case_number, pcl_case_type, pcl_case_year, pcl_court_id, pcl_date_filed, pcl_last_name, pcl_first_name, pcl_middle_name, pcl_generation, pcl_party_role, pcl_party_type, pcl_court_case, *args, **kwargs): # noqa: E501 - """PACERPartySearchContent - a model defined in OpenAPI - - Args: - pcl_jurisdiction_type (str, none_type): Link to case in the case management/electronic case files (CM/ECF) system at the court. - pcl_case_id (int): Sequentially generated number that identifies the case. - pcl_case_number_full (str, none_type): Case Number. - pcl_case_title (str, none_type): Title of the case. - pcl_case_office (str, none_type): The divisional office in which the case was filed. - pcl_case_number (int): The sequence number of the case. - pcl_case_type (str, none_type): Code that identifies the type of case. - pcl_case_year (int): The year in which the case falls. Could be two or four digit. - pcl_court_id (str, none_type): The general geographical region or specific court district. The court ID is the abbreviation of the court location combined with the court type (dc or bk). Please refer the Appendix B - pcl_date_filed (str, none_type): Filing date of the case. - pcl_last_name (str, none_type): This parameter represents the last name of the case when it is present - pcl_first_name (str, none_type): This parameter represents the first name of the case when it is present - pcl_middle_name (str, none_type): This parameter represents the middle name of the case when it is present - pcl_generation (str, none_type): This parameter represents the generation of the case when it is present - pcl_party_role (str, none_type): This parameter represents the party role of the case when it is present - pcl_party_type (str, none_type): This parameter represents the party type of the case when it is present - pcl_court_case (PACERCaseSearchContent): - - Keyword Args: - object (str): Name of the object. defaults to "PACERPartySearchContent" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - object = kwargs.get('object', "PACERPartySearchContent") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.pcl_jurisdiction_type = pcl_jurisdiction_type - self.pcl_case_id = pcl_case_id - self.pcl_case_number_full = pcl_case_number_full - self.pcl_case_title = pcl_case_title - self.pcl_case_office = pcl_case_office - self.pcl_case_number = pcl_case_number - self.pcl_case_type = pcl_case_type - self.pcl_case_year = pcl_case_year - self.pcl_court_id = pcl_court_id - self.pcl_date_filed = pcl_date_filed - self.pcl_last_name = pcl_last_name - self.pcl_first_name = pcl_first_name - self.pcl_middle_name = pcl_middle_name - self.pcl_generation = pcl_generation - self.pcl_party_role = pcl_party_role - self.pcl_party_type = pcl_party_type - self.pcl_court_case = pcl_court_case - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/pacer_party_search_results.py b/unicourt/model/pacer_party_search_results.py index a90f8d7..5b2315c 100644 --- a/unicourt/model/pacer_party_search_results.py +++ b/unicourt/model/pacer_party_search_results.py @@ -1,301 +1,102 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.case_search_result import CaseSearchResult - from unicourt.model.pacer_party_search_content import PACERPartySearchContent - globals()['CaseSearchResult'] = CaseSearchResult - globals()['PACERPartySearchContent'] = PACERPartySearchContent +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class PACERPartySearchResults(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_search_result import CaseSearchResult +from unicourt.model.pacer_party_search_content import PACERPartySearchContent +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PACERPartySearchResults(BaseModel): """ + PACERPartySearchResults + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=23, strict=True, max_length=23)]] = Field(default='PACERPartySearchResults', description="Name of the object") + pacer_content: Optional[PACERPartySearchContent] = Field(default=None, alias="pacerContent") + has_only_meta_info: Optional[StrictBool] = Field(default=None, description="This field determines if the UniCourt Content has only meta information. If the value is true and you require to get the latest updates of the case you will need to make a request to the updateCase API.", alias="hasOnlyMetaInfo") + uni_court_content: Optional[CaseSearchResult] = Field(default=None, alias="uniCourtContent") + __properties: ClassVar[List[str]] = ["object", "pacerContent", "hasOnlyMetaInfo", "uniCourtContent"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 23, - 'min_length': 23, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PACERPartySearchResults from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'pacer_content': (PACERPartySearchContent,), # noqa: E501 - 'has_only_meta_info': (bool,), # noqa: E501 - 'uni_court_content': (CaseSearchResult,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'pacer_content': 'pacerContent', # noqa: E501 - 'has_only_meta_info': 'hasOnlyMetaInfo', # noqa: E501 - 'uni_court_content': 'uniCourtContent', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pacer_content + if self.pacer_content: + _dict['pacerContent'] = self.pacer_content.to_dict() + # override the default output from pydantic by calling `to_dict()` of uni_court_content + if self.uni_court_content: + _dict['uniCourtContent'] = self.uni_court_content.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, pacer_content, has_only_meta_info, uni_court_content, *args, **kwargs): # noqa: E501 - """PACERPartySearchResults - a model defined in OpenAPI - - Args: - pacer_content (PACERPartySearchContent): - has_only_meta_info (bool): This field determines if the UniCourt Content has only meta information. If the value is true and you require to get the latest updates of the case you will need to make a request to the updateCase API. - uni_court_content (CaseSearchResult): - - Keyword Args: - object (str): Name of the object. defaults to "PACERPartySearchResults" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PACERPartySearchResults") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.pacer_content = pacer_content - self.has_only_meta_info = has_only_meta_info - self.uni_court_content = uni_court_content - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, pacer_content, has_only_meta_info, uni_court_content, *args, **kwargs): # noqa: E501 - """PACERPartySearchResults - a model defined in OpenAPI - - Args: - pacer_content (PACERPartySearchContent): - has_only_meta_info (bool): This field determines if the UniCourt Content has only meta information. If the value is true and you require to get the latest updates of the case you will need to make a request to the updateCase API. - uni_court_content (CaseSearchResult): - - Keyword Args: - object (str): Name of the object. defaults to "PACERPartySearchResults" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PACERPartySearchResults from a dict""" + if obj is None: + return None - object = kwargs.get('object', "PACERPartySearchResults") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PACERPartySearchResults', + "pacerContent": PACERPartySearchContent.from_dict(obj["pacerContent"]) if obj.get("pacerContent") is not None else None, + "hasOnlyMetaInfo": obj.get("hasOnlyMetaInfo"), + "uniCourtContent": CaseSearchResult.from_dict(obj["uniCourtContent"]) if obj.get("uniCourtContent") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.pacer_content = pacer_content - self.has_only_meta_info = has_only_meta_info - self.uni_court_content = uni_court_content - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/pacer_search_page_info.py b/unicourt/model/pacer_search_page_info.py index b993da9..5ff4c44 100644 --- a/unicourt/model/pacer_search_page_info.py +++ b/unicourt/model/pacer_search_page_info.py @@ -1,317 +1,102 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class PACERSearchPageInfo(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 19, - 'min_length': 19, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'number': (int,), # noqa: E501 - 'size': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_elements': (int,), # noqa: E501 - 'number_of_elements': (int,), # noqa: E501 - 'first': (bool,), # noqa: E501 - 'last': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'number': 'number', # noqa: E501 - 'size': 'size', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_elements': 'totalElements', # noqa: E501 - 'number_of_elements': 'numberOfElements', # noqa: E501 - 'first': 'first', # noqa: E501 - 'last': 'last', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class PACERSearchPageInfo(BaseModel): + """ + PACERSearchPageInfo + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=19, strict=True, max_length=19)]] = Field(default='PACERSearchPageInfo', description="Name of the object") + number: Optional[StrictInt] = Field(default=None, description="Current Page number.") + size: Optional[StrictInt] = Field(default=None, description="Number of results obtained in a page..") + total_pages: Optional[StrictInt] = Field(default=None, description="Total pages of data available.", alias="totalPages") + total_elements: Optional[StrictInt] = Field(default=None, description="Total number of records available", alias="totalElements") + number_of_elements: Optional[StrictInt] = Field(default=None, description="Number of records returned.", alias="numberOfElements") + first: Optional[StrictBool] = Field(default=None, description="Indicates if the current page is the first page.") + last: Optional[StrictBool] = Field(default=None, description="Indicates if the current page is the last page.") + __properties: ClassVar[List[str]] = ["object", "number", "size", "totalPages", "totalElements", "numberOfElements", "first", "last"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, number, size, total_pages, total_elements, number_of_elements, first, last, *args, **kwargs): # noqa: E501 - """PACERSearchPageInfo - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PACERSearchPageInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - number (int): Current Page number. - size (int): Number of results obtained in a page.. - total_pages (int): Total pages of data available. - total_elements (int): Total number of records available - number_of_elements (int): Number of records returned. - first (bool): Indicates if the current page is the first page. - last (bool): Indicates if the current page is the last page. - - Keyword Args: - object (str): Name of the object. defaults to "PACERSearchPageInfo" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "PACERSearchPageInfo") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.number = number - self.size = size - self.total_pages = total_pages - self.total_elements = total_elements - self.number_of_elements = number_of_elements - self.first = first - self.last = last - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, number, size, total_pages, total_elements, number_of_elements, first, last, *args, **kwargs): # noqa: E501 - """PACERSearchPageInfo - a model defined in OpenAPI - - Args: - number (int): Current Page number. - size (int): Number of results obtained in a page.. - total_pages (int): Total pages of data available. - total_elements (int): Total number of records available - number_of_elements (int): Number of records returned. - first (bool): Indicates if the current page is the first page. - last (bool): Indicates if the current page is the last page. - - Keyword Args: - object (str): Name of the object. defaults to "PACERSearchPageInfo" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) - object = kwargs.get('object', "PACERSearchPageInfo") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PACERSearchPageInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PACERSearchPageInfo', + "number": obj.get("number"), + "size": obj.get("size"), + "totalPages": obj.get("totalPages"), + "totalElements": obj.get("totalElements"), + "numberOfElements": obj.get("numberOfElements"), + "first": obj.get("first"), + "last": obj.get("last") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.number = number - self.size = size - self.total_pages = total_pages - self.total_elements = total_elements - self.number_of_elements = number_of_elements - self.first = first - self.last = last - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/pacer_search_receipt.py b/unicourt/model/pacer_search_receipt.py index bfba1b5..e8f8ed9 100644 --- a/unicourt/model/pacer_search_receipt.py +++ b/unicourt/model/pacer_search_receipt.py @@ -1,363 +1,139 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class PACERSearchReceipt(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 18, - 'min_length': 18, - }, - ('transaction_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('search_fee',): { - 'max_length': 5, - 'min_length': 3, - }, - ('login_id',): { - 'max_length': 40, - }, - ('client_code',): { - 'max_length': 100, - }, - ('firm_id',): { - 'max_length': 100, - }, - ('search',): { - 'max_length': 1000000, - }, - ('description',): { - 'max_length': 100, - }, - ('cso_id',): { - }, - ('report_id',): { - 'max_length': 100, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'transaction_date': (datetime,), # noqa: E501 - 'search_fee': (str,), # noqa: E501 - 'billable_pages': (int,), # noqa: E501 - 'login_id': (str,), # noqa: E501 - 'client_code': (str, none_type,), # noqa: E501 - 'firm_id': (str, none_type,), # noqa: E501 - 'search': (str, none_type,), # noqa: E501 - 'description': (str, none_type,), # noqa: E501 - 'cso_id': (int, none_type,), # noqa: E501 - 'report_id': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'transaction_date': 'transactionDate', # noqa: E501 - 'search_fee': 'searchFee', # noqa: E501 - 'billable_pages': 'billablePages', # noqa: E501 - 'login_id': 'loginId', # noqa: E501 - 'client_code': 'clientCode', # noqa: E501 - 'firm_id': 'firmId', # noqa: E501 - 'search': 'search', # noqa: E501 - 'description': 'description', # noqa: E501 - 'cso_id': 'csoId', # noqa: E501 - 'report_id': 'reportId', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class PACERSearchReceipt(BaseModel): + """ + PACERSearchReceipt + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default='PACERSearchReceipt', description="Name of the object") + transaction_date: Optional[datetime] = Field(default=None, description="Date when the transaction was made at the pacer court site.", alias="transactionDate") + search_fee: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=5)]] = Field(default=None, description="PACER Search Fee.", alias="searchFee") + billable_pages: Optional[StrictInt] = Field(default=None, description="No of pages that was billed for the given PACER search.", alias="billablePages") + login_id: Optional[Annotated[str, Field(strict=True, max_length=40)]] = Field(default=None, description="ID which is used for PACER login.", alias="loginId") + client_code: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="client code added if any was set.", alias="clientCode") + firm_id: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Firm ID.", alias="firmId") + search: Optional[Annotated[str, Field(strict=True, max_length=1000000)]] = Field(default=None, description="Details of the search made for this request.") + description: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Description of the search made.") + cso_id: Optional[Annotated[int, Field(strict=True)]] = Field(default=None, description="PACER Account ID.", alias="csoId") + report_id: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Report ID for the search made.", alias="reportId") + __properties: ClassVar[List[str]] = ["object", "transactionDate", "searchFee", "billablePages", "loginId", "clientCode", "firmId", "search", "description", "csoId", "reportId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, transaction_date, search_fee, billable_pages, login_id, client_code, firm_id, search, description, cso_id, report_id, *args, **kwargs): # noqa: E501 - """PACERSearchReceipt - a model defined in OpenAPI - - Args: - transaction_date (datetime): Date when the transaction was made at the pacer court site. - search_fee (str): PACER Search Fee. - billable_pages (int): No of pages that was billed for the given PACER search. - login_id (str): ID which is used for PACER login. - client_code (str, none_type): client code added if any was set. - firm_id (str, none_type): Firm ID. - search (str, none_type): Details of the search made for this request. - description (str, none_type): Description of the search made. - cso_id (int, none_type): PACER Account ID. - report_id (str, none_type): Report ID for the search made. - - Keyword Args: - object (str): Name of the object. defaults to "PACERSearchReceipt" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PACERSearchReceipt from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "PACERSearchReceipt") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.transaction_date = transaction_date - self.search_fee = search_fee - self.billable_pages = billable_pages - self.login_id = login_id - self.client_code = client_code - self.firm_id = firm_id - self.search = search - self.description = description - self.cso_id = cso_id - self.report_id = report_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, transaction_date, search_fee, billable_pages, login_id, client_code, firm_id, search, description, cso_id, report_id, *args, **kwargs): # noqa: E501 - """PACERSearchReceipt - a model defined in OpenAPI - - Args: - transaction_date (datetime): Date when the transaction was made at the pacer court site. - search_fee (str): PACER Search Fee. - billable_pages (int): No of pages that was billed for the given PACER search. - login_id (str): ID which is used for PACER login. - client_code (str, none_type): client code added if any was set. - firm_id (str, none_type): Firm ID. - search (str, none_type): Details of the search made for this request. - description (str, none_type): Description of the search made. - cso_id (int, none_type): PACER Account ID. - report_id (str, none_type): Report ID for the search made. - - Keyword Args: - object (str): Name of the object. defaults to "PACERSearchReceipt" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if client_code (nullable) is None + # and model_fields_set contains the field + if self.client_code is None and "client_code" in self.model_fields_set: + _dict['clientCode'] = None + + # set to None if firm_id (nullable) is None + # and model_fields_set contains the field + if self.firm_id is None and "firm_id" in self.model_fields_set: + _dict['firmId'] = None + + # set to None if search (nullable) is None + # and model_fields_set contains the field + if self.search is None and "search" in self.model_fields_set: + _dict['search'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if cso_id (nullable) is None + # and model_fields_set contains the field + if self.cso_id is None and "cso_id" in self.model_fields_set: + _dict['csoId'] = None + + # set to None if report_id (nullable) is None + # and model_fields_set contains the field + if self.report_id is None and "report_id" in self.model_fields_set: + _dict['reportId'] = None + + return _dict - object = kwargs.get('object', "PACERSearchReceipt") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PACERSearchReceipt from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PACERSearchReceipt', + "transactionDate": obj.get("transactionDate"), + "searchFee": obj.get("searchFee"), + "billablePages": obj.get("billablePages"), + "loginId": obj.get("loginId"), + "clientCode": obj.get("clientCode"), + "firmId": obj.get("firmId"), + "search": obj.get("search"), + "description": obj.get("description"), + "csoId": obj.get("csoId"), + "reportId": obj.get("reportId") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.transaction_date = transaction_date - self.search_fee = search_fee - self.billable_pages = billable_pages - self.login_id = login_id - self.client_code = client_code - self.firm_id = firm_id - self.search = search - self.description = description - self.cso_id = cso_id - self.report_id = report_id - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/parties.py b/unicourt/model/parties.py index b4023f7..6b88df5 100644 --- a/unicourt/model/parties.py +++ b/unicourt/model/parties.py @@ -1,317 +1,111 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.party import Party - globals()['Party'] = Party +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class Parties(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.party import Party +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class Parties(BaseModel): """ + Parties + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=7)]] = Field(default='Parties', description="Name of the object") + page_number: Optional[StrictInt] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + party_array: Optional[Annotated[List[Party], Field(max_length=25)]] = Field(default=None, alias="partyArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to next page of a particular entity in a Case.", alias="nextPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects of a party in the Case.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of parties of the Case entity in a Case.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "pageNumber", "partyArray", "nextPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 7, - 'min_length': 7, - }, - ('party_array',): { - 'max_items': 25, - }, - ('next_page_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Parties from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'party_array': ([Party],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'party_array': 'partyArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in party_array (list) + _items = [] + if self.party_array: + for _item in self.party_array: + if _item: + _items.append(_item.to_dict()) + _dict['partyArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, page_number, party_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """Parties - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - party_array ([Party]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "Parties" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "Parties") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.page_number = page_number - self.party_array = party_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, page_number, party_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """Parties - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - party_array ([Party]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "Parties" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Parties from a dict""" + if obj is None: + return None - object = kwargs.get('object', "Parties") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Parties', + "pageNumber": obj.get("pageNumber"), + "partyArray": [Party.from_dict(_item) for _item in obj["partyArray"]] if obj.get("partyArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.page_number = page_number - self.party_array = party_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/party.py b/unicourt/model/party.py index 13a8d43..e142721 100644 --- a/unicourt/model/party.py +++ b/unicourt/model/party.py @@ -1,433 +1,182 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.attorney_representation_type import AttorneyRepresentationType - from unicourt.model.contact import Contact - from unicourt.model.party_attorney_associations import PartyAttorneyAssociations - from unicourt.model.party_role import PartyRole - from unicourt.model.possible_norm_party import PossibleNormParty - globals()['AttorneyRepresentationType'] = AttorneyRepresentationType - globals()['Contact'] = Contact - globals()['PartyAttorneyAssociations'] = PartyAttorneyAssociations - globals()['PartyRole'] = PartyRole - globals()['PossibleNormParty'] = PossibleNormParty - - -class Party(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('party_classification_type',): { - 'INDIVIDUAL': "INDIVIDUAL", - 'COMPANY': "COMPANY", - 'OTHER': "OTHER", - }, - } - - validations = { - ('object',): { - 'max_length': 5, - 'min_length': 5, - }, - ('party_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 250, - 'min_length': 1, - }, - ('name_prefix',): { - 'max_length': 10, - }, - ('first_name',): { - 'max_length': 250, - }, - ('middle_name',): { - 'max_length': 100, - }, - ('last_name',): { - 'max_length': 100, - }, - ('name_suffix',): { - 'max_length': 10, - }, - ('party_classification_type',): { - 'max_length': 50, - }, - ('source_party_role',): { - 'max_length': 100, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'party_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'name_prefix': (str, none_type,), # noqa: E501 - 'first_name': (str, none_type,), # noqa: E501 - 'middle_name': (str, none_type,), # noqa: E501 - 'last_name': (str, none_type,), # noqa: E501 - 'name_suffix': (str, none_type,), # noqa: E501 - 'contact': (Contact,), # noqa: E501 - 'party_classification_type': (str,), # noqa: E501 - 'party_role': (PartyRole,), # noqa: E501 - 'source_party_role': (str,), # noqa: E501 - 'is_visible': (bool,), # noqa: E501 - 'first_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date': (datetime,), # noqa: E501 - 'attorney_representation_type': (AttorneyRepresentationType,), # noqa: E501 - 'party_attorney_associations': (PartyAttorneyAssociations,), # noqa: E501 - 'possible_norm_party_array': ([PossibleNormParty],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'party_id': 'partyId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'name_prefix': 'namePrefix', # noqa: E501 - 'first_name': 'firstName', # noqa: E501 - 'middle_name': 'middleName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - 'name_suffix': 'nameSuffix', # noqa: E501 - 'contact': 'contact', # noqa: E501 - 'party_classification_type': 'partyClassificationType', # noqa: E501 - 'party_role': 'partyRole', # noqa: E501 - 'source_party_role': 'sourcePartyRole', # noqa: E501 - 'is_visible': 'isVisible', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'attorney_representation_type': 'attorneyRepresentationType', # noqa: E501 - 'party_attorney_associations': 'partyAttorneyAssociations', # noqa: E501 - 'possible_norm_party_array': 'possibleNormPartyArray', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.attorney_representation_type import AttorneyRepresentationType +from unicourt.model.contact import Contact +from unicourt.model.party_attorney_associations import PartyAttorneyAssociations +from unicourt.model.party_role import PartyRole +from unicourt.model.possible_norm_party import PossibleNormParty +from typing import Optional, Set +from typing_extensions import Self + +class Party(BaseModel): + """ + Party + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=5, strict=True, max_length=5)]] = Field(default='Party', description="Name of the object") + party_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="ID for the party in this case. This ID is unique within a case and NOT across cases. If the same party were to appear in another case this ID would be different.", alias="partyId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=250)]] = Field(default=None, description="Name of the party as provided by Court.") + name_prefix: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, alias="namePrefix") + first_name: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="First name of the party. This is normalized by UniCourt.", alias="firstName") + middle_name: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Middle name of the party. This is normalized by UniCourt.", alias="middleName") + last_name: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Last name of the party. This is normalized by UniCourt.", alias="lastName") + name_suffix: Optional[Annotated[str, Field(strict=True, max_length=10)]] = Field(default=None, alias="nameSuffix") + contact: Optional[Contact] = None + party_classification_type: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="To know the type of an entity in a case, if it is an Individual, Company or Other. An entity to a case could be the parties, attorneys or judges involved.", alias="partyClassificationType") + party_role: Optional[PartyRole] = Field(default=None, alias="partyRole") + source_party_role: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Party Type as provided by Court.", alias="sourcePartyRole") + is_visible: Optional[StrictBool] = Field(default=None, description="Signifies if the party as this party type is currently isVisible or not for the case.", alias="isVisible") + first_fetch_date: Optional[datetime] = Field(default=None, description="When was the party first fetched from the court site.", alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, description="When was the party last fetched from the court site.", alias="lastFetchDate") + attorney_representation_type: Optional[AttorneyRepresentationType] = Field(default=None, alias="attorneyRepresentationType") + party_attorney_associations: Optional[PartyAttorneyAssociations] = Field(default=None, alias="partyAttorneyAssociations") + possible_norm_party_array: Optional[List[PossibleNormParty]] = Field(default=None, alias="possibleNormPartyArray") + __properties: ClassVar[List[str]] = ["object", "partyId", "name", "namePrefix", "firstName", "middleName", "lastName", "nameSuffix", "contact", "partyClassificationType", "partyRole", "sourcePartyRole", "isVisible", "firstFetchDate", "lastFetchDate", "attorneyRepresentationType", "partyAttorneyAssociations", "possibleNormPartyArray"] + + @field_validator('party_classification_type') + def party_classification_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['INDIVIDUAL', 'COMPANY', 'OTHER']): + raise ValueError("must be one of enum values ('INDIVIDUAL', 'COMPANY', 'OTHER')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, party_id, name, name_prefix, first_name, middle_name, last_name, name_suffix, contact, party_classification_type, party_role, source_party_role, is_visible, first_fetch_date, last_fetch_date, attorney_representation_type, party_attorney_associations, possible_norm_party_array, *args, **kwargs): # noqa: E501 - """Party - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Party from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - party_id (str): ID for the party in this case. This ID is unique within a case and NOT across cases. If the same party were to appear in another case this ID would be different. - name (str): Name of the party as provided by Court. - name_prefix (str, none_type): - first_name (str, none_type): First name of the party. This is normalized by UniCourt. - middle_name (str, none_type): Middle name of the party. This is normalized by UniCourt. - last_name (str, none_type): Last name of the party. This is normalized by UniCourt. - name_suffix (str, none_type): - contact (Contact): - party_classification_type (str): To know the type of an entity in a case, if it is an Individual, Company or Other. An entity to a case could be the parties, attorneys or judges involved. - party_role (PartyRole): - source_party_role (str): Party Type as provided by Court. - is_visible (bool): Signifies if the party as this party type is currently isVisible or not for the case. - first_fetch_date (datetime): When was the party first fetched from the court site. - last_fetch_date (datetime): When was the party last fetched from the court site. - attorney_representation_type (AttorneyRepresentationType): - party_attorney_associations (PartyAttorneyAssociations): - possible_norm_party_array ([PossibleNormParty]): - - Keyword Args: - object (str): Name of the object. defaults to "Party" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "Party") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.party_id = party_id - self.name = name - self.name_prefix = name_prefix - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.name_suffix = name_suffix - self.contact = contact - self.party_classification_type = party_classification_type - self.party_role = party_role - self.source_party_role = source_party_role - self.is_visible = is_visible - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.attorney_representation_type = attorney_representation_type - self.party_attorney_associations = party_attorney_associations - self.possible_norm_party_array = possible_norm_party_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, party_id, name, name_prefix, first_name, middle_name, last_name, name_suffix, contact, party_classification_type, party_role, source_party_role, is_visible, first_fetch_date, last_fetch_date, attorney_representation_type, party_attorney_associations, possible_norm_party_array, *args, **kwargs): # noqa: E501 - """Party - a model defined in OpenAPI - - Args: - party_id (str): ID for the party in this case. This ID is unique within a case and NOT across cases. If the same party were to appear in another case this ID would be different. - name (str): Name of the party as provided by Court. - name_prefix (str, none_type): - first_name (str, none_type): First name of the party. This is normalized by UniCourt. - middle_name (str, none_type): Middle name of the party. This is normalized by UniCourt. - last_name (str, none_type): Last name of the party. This is normalized by UniCourt. - name_suffix (str, none_type): - contact (Contact): - party_classification_type (str): To know the type of an entity in a case, if it is an Individual, Company or Other. An entity to a case could be the parties, attorneys or judges involved. - party_role (PartyRole): - source_party_role (str): Party Type as provided by Court. - is_visible (bool): Signifies if the party as this party type is currently isVisible or not for the case. - first_fetch_date (datetime): When was the party first fetched from the court site. - last_fetch_date (datetime): When was the party last fetched from the court site. - attorney_representation_type (AttorneyRepresentationType): - party_attorney_associations (PartyAttorneyAssociations): - possible_norm_party_array ([PossibleNormParty]): - - Keyword Args: - object (str): Name of the object. defaults to "Party" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of contact + if self.contact: + _dict['contact'] = self.contact.to_dict() + # override the default output from pydantic by calling `to_dict()` of party_role + if self.party_role: + _dict['partyRole'] = self.party_role.to_dict() + # override the default output from pydantic by calling `to_dict()` of attorney_representation_type + if self.attorney_representation_type: + _dict['attorneyRepresentationType'] = self.attorney_representation_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of party_attorney_associations + if self.party_attorney_associations: + _dict['partyAttorneyAssociations'] = self.party_attorney_associations.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in possible_norm_party_array (list) + _items = [] + if self.possible_norm_party_array: + for _item in self.possible_norm_party_array: + if _item: + _items.append(_item.to_dict()) + _dict['possibleNormPartyArray'] = _items + # set to None if name_prefix (nullable) is None + # and model_fields_set contains the field + if self.name_prefix is None and "name_prefix" in self.model_fields_set: + _dict['namePrefix'] = None + + # set to None if first_name (nullable) is None + # and model_fields_set contains the field + if self.first_name is None and "first_name" in self.model_fields_set: + _dict['firstName'] = None + + # set to None if middle_name (nullable) is None + # and model_fields_set contains the field + if self.middle_name is None and "middle_name" in self.model_fields_set: + _dict['middleName'] = None + + # set to None if last_name (nullable) is None + # and model_fields_set contains the field + if self.last_name is None and "last_name" in self.model_fields_set: + _dict['lastName'] = None + + # set to None if name_suffix (nullable) is None + # and model_fields_set contains the field + if self.name_suffix is None and "name_suffix" in self.model_fields_set: + _dict['nameSuffix'] = None + + return _dict - object = kwargs.get('object', "Party") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Party from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Party', + "partyId": obj.get("partyId"), + "name": obj.get("name"), + "namePrefix": obj.get("namePrefix"), + "firstName": obj.get("firstName"), + "middleName": obj.get("middleName"), + "lastName": obj.get("lastName"), + "nameSuffix": obj.get("nameSuffix"), + "contact": Contact.from_dict(obj["contact"]) if obj.get("contact") is not None else None, + "partyClassificationType": obj.get("partyClassificationType"), + "partyRole": PartyRole.from_dict(obj["partyRole"]) if obj.get("partyRole") is not None else None, + "sourcePartyRole": obj.get("sourcePartyRole"), + "isVisible": obj.get("isVisible"), + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate"), + "attorneyRepresentationType": AttorneyRepresentationType.from_dict(obj["attorneyRepresentationType"]) if obj.get("attorneyRepresentationType") is not None else None, + "partyAttorneyAssociations": PartyAttorneyAssociations.from_dict(obj["partyAttorneyAssociations"]) if obj.get("partyAttorneyAssociations") is not None else None, + "possibleNormPartyArray": [PossibleNormParty.from_dict(_item) for _item in obj["possibleNormPartyArray"]] if obj.get("possibleNormPartyArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.party_id = party_id - self.name = name - self.name_prefix = name_prefix - self.first_name = first_name - self.middle_name = middle_name - self.last_name = last_name - self.name_suffix = name_suffix - self.contact = contact - self.party_classification_type = party_classification_type - self.party_role = party_role - self.source_party_role = source_party_role - self.is_visible = is_visible - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.attorney_representation_type = attorney_representation_type - self.party_attorney_associations = party_attorney_associations - self.possible_norm_party_array = possible_norm_party_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/party_analytics_api.py b/unicourt/model/party_analytics_api.py index 0457f8d..b09edc7 100644 --- a/unicourt/model/party_analytics_api.py +++ b/unicourt/model/party_analytics_api.py @@ -1,337 +1,112 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class PartyAnalyticsAPI(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 17, - }, - ('norm_party_api',): { - 'max_length': 255, - }, - ('associated_norm_attorneys_api',): { - 'max_length': 255, - }, - ('associated_norm_law_firms_api',): { - 'max_length': 255, - }, - ('associated_norm_judges_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_opposing_norm_attorney_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_opposing_norm_law_firm_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_opposing_norm_party_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'norm_party_api': (str,), # noqa: E501 - 'associated_norm_attorneys_api': (str,), # noqa: E501 - 'associated_norm_law_firms_api': (str,), # noqa: E501 - 'associated_norm_judges_api': (str,), # noqa: E501 - 'case_count_analytics_by_opposing_norm_attorney_api': (str, none_type,), # noqa: E501 - 'case_count_analytics_by_opposing_norm_law_firm_api': (str, none_type,), # noqa: E501 - 'case_count_analytics_by_opposing_norm_party_api': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_party_api': 'normPartyAPI', # noqa: E501 - 'associated_norm_attorneys_api': 'associatedNormAttorneysAPI', # noqa: E501 - 'associated_norm_law_firms_api': 'associatedNormLawFirmsAPI', # noqa: E501 - 'associated_norm_judges_api': 'associatedNormJudgesAPI', # noqa: E501 - 'case_count_analytics_by_opposing_norm_attorney_api': 'caseCountAnalyticsByOpposingNormAttorneyAPI', # noqa: E501 - 'case_count_analytics_by_opposing_norm_law_firm_api': 'caseCountAnalyticsByOpposingNormLawFirmAPI', # noqa: E501 - 'case_count_analytics_by_opposing_norm_party_api': 'caseCountAnalyticsByOpposingNormPartyAPI', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class PartyAnalyticsAPI(BaseModel): + """ + PartyAnalyticsAPI + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=17)]] = 'PartyAnalyticsAPI' + norm_party_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to Details for the Party.", alias="normPartyAPI") + associated_norm_attorneys_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormAttorneysAPI") + associated_norm_law_firms_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormLawFirmsAPI") + associated_norm_judges_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormJudgesAPI") + case_count_analytics_by_opposing_norm_attorney_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByOpposingNormAttorneyAPI") + case_count_analytics_by_opposing_norm_law_firm_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByOpposingNormLawFirmAPI") + case_count_analytics_by_opposing_norm_party_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByOpposingNormPartyAPI") + __properties: ClassVar[List[str]] = ["object", "normPartyAPI", "associatedNormAttorneysAPI", "associatedNormLawFirmsAPI", "associatedNormJudgesAPI", "caseCountAnalyticsByOpposingNormAttorneyAPI", "caseCountAnalyticsByOpposingNormLawFirmAPI", "caseCountAnalyticsByOpposingNormPartyAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_party_api, associated_norm_attorneys_api, associated_norm_law_firms_api, associated_norm_judges_api, case_count_analytics_by_opposing_norm_attorney_api, case_count_analytics_by_opposing_norm_law_firm_api, case_count_analytics_by_opposing_norm_party_api, *args, **kwargs): # noqa: E501 - """PartyAnalyticsAPI - a model defined in OpenAPI - - Args: - norm_party_api (str): Link to Details for the Party. - associated_norm_attorneys_api (str): - associated_norm_law_firms_api (str): - associated_norm_judges_api (str): - case_count_analytics_by_opposing_norm_attorney_api (str, none_type): - case_count_analytics_by_opposing_norm_law_firm_api (str, none_type): - case_count_analytics_by_opposing_norm_party_api (str): - - Keyword Args: - object (str): defaults to "PartyAnalyticsAPI" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PartyAnalyticsAPI from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "PartyAnalyticsAPI") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_party_api = norm_party_api - self.associated_norm_attorneys_api = associated_norm_attorneys_api - self.associated_norm_law_firms_api = associated_norm_law_firms_api - self.associated_norm_judges_api = associated_norm_judges_api - self.case_count_analytics_by_opposing_norm_attorney_api = case_count_analytics_by_opposing_norm_attorney_api - self.case_count_analytics_by_opposing_norm_law_firm_api = case_count_analytics_by_opposing_norm_law_firm_api - self.case_count_analytics_by_opposing_norm_party_api = case_count_analytics_by_opposing_norm_party_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_party_api, associated_norm_attorneys_api, associated_norm_law_firms_api, associated_norm_judges_api, case_count_analytics_by_opposing_norm_attorney_api, case_count_analytics_by_opposing_norm_law_firm_api, case_count_analytics_by_opposing_norm_party_api, *args, **kwargs): # noqa: E501 - """PartyAnalyticsAPI - a model defined in OpenAPI - - Args: - norm_party_api (str): Link to Details for the Party. - associated_norm_attorneys_api (str): - associated_norm_law_firms_api (str): - associated_norm_judges_api (str): - case_count_analytics_by_opposing_norm_attorney_api (str, none_type): - case_count_analytics_by_opposing_norm_law_firm_api (str, none_type): - case_count_analytics_by_opposing_norm_party_api (str): - - Keyword Args: - object (str): defaults to "PartyAnalyticsAPI" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if case_count_analytics_by_opposing_norm_attorney_api (nullable) is None + # and model_fields_set contains the field + if self.case_count_analytics_by_opposing_norm_attorney_api is None and "case_count_analytics_by_opposing_norm_attorney_api" in self.model_fields_set: + _dict['caseCountAnalyticsByOpposingNormAttorneyAPI'] = None + + # set to None if case_count_analytics_by_opposing_norm_law_firm_api (nullable) is None + # and model_fields_set contains the field + if self.case_count_analytics_by_opposing_norm_law_firm_api is None and "case_count_analytics_by_opposing_norm_law_firm_api" in self.model_fields_set: + _dict['caseCountAnalyticsByOpposingNormLawFirmAPI'] = None + + return _dict - object = kwargs.get('object', "PartyAnalyticsAPI") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartyAnalyticsAPI from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PartyAnalyticsAPI', + "normPartyAPI": obj.get("normPartyAPI"), + "associatedNormAttorneysAPI": obj.get("associatedNormAttorneysAPI"), + "associatedNormLawFirmsAPI": obj.get("associatedNormLawFirmsAPI"), + "associatedNormJudgesAPI": obj.get("associatedNormJudgesAPI"), + "caseCountAnalyticsByOpposingNormAttorneyAPI": obj.get("caseCountAnalyticsByOpposingNormAttorneyAPI"), + "caseCountAnalyticsByOpposingNormLawFirmAPI": obj.get("caseCountAnalyticsByOpposingNormLawFirmAPI"), + "caseCountAnalyticsByOpposingNormPartyAPI": obj.get("caseCountAnalyticsByOpposingNormPartyAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_party_api = norm_party_api - self.associated_norm_attorneys_api = associated_norm_attorneys_api - self.associated_norm_law_firms_api = associated_norm_law_firms_api - self.associated_norm_judges_api = associated_norm_judges_api - self.case_count_analytics_by_opposing_norm_attorney_api = case_count_analytics_by_opposing_norm_attorney_api - self.case_count_analytics_by_opposing_norm_law_firm_api = case_count_analytics_by_opposing_norm_law_firm_api - self.case_count_analytics_by_opposing_norm_party_api = case_count_analytics_by_opposing_norm_party_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/party_attorney_association.py b/unicourt/model/party_attorney_association.py index e11c7c2..601a6a4 100644 --- a/unicourt/model/party_attorney_association.py +++ b/unicourt/model/party_attorney_association.py @@ -1,311 +1,96 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class PartyAttorneyAssociation(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PartyAttorneyAssociation(BaseModel): """ + PartyAttorneyAssociation + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=24, strict=True, max_length=24)]] = Field(default='PartyAttorneyAssociation', description="Name of the object") + party_attorney_association_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="ID of the association", alias="partyAttorneyAssociationId") + attorney_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="ID for the attorney in this case. This ID is unique within a case and NOT across cases. If the same attorney were to appear in another case this ID would be different.", alias="attorneyId") + party_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="ID for the party in this case. This ID is unique within a case and NOT across cases. If the same attorney were to appear in another case this ID would be different.", alias="partyId") + is_visible: Optional[StrictBool] = Field(default=None, description="Signifies if this party attorney relationship is currently isVisible or not for the case.", alias="isVisible") + __properties: ClassVar[List[str]] = ["object", "partyAttorneyAssociationId", "attorneyId", "partyId", "isVisible"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 24, - 'min_length': 24, - }, - ('party_attorney_association_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('attorney_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('party_id',): { - 'max_length': 18, - 'min_length': 18, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PartyAttorneyAssociation from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'party_attorney_association_id': (str,), # noqa: E501 - 'attorney_id': (str,), # noqa: E501 - 'party_id': (str,), # noqa: E501 - 'is_visible': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'party_attorney_association_id': 'partyAttorneyAssociationId', # noqa: E501 - 'attorney_id': 'attorneyId', # noqa: E501 - 'party_id': 'partyId', # noqa: E501 - 'is_visible': 'isVisible', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, party_attorney_association_id, attorney_id, party_id, is_visible, *args, **kwargs): # noqa: E501 - """PartyAttorneyAssociation - a model defined in OpenAPI - - Args: - party_attorney_association_id (str): ID of the association - attorney_id (str): ID for the attorney in this case. This ID is unique within a case and NOT across cases. If the same attorney were to appear in another case this ID would be different. - party_id (str): ID for the party in this case. This ID is unique within a case and NOT across cases. If the same attorney were to appear in another case this ID would be different. - is_visible (bool): Signifies if this party attorney relationship is currently isVisible or not for the case. - - Keyword Args: - object (str): Name of the object. defaults to "PartyAttorneyAssociation" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PartyAttorneyAssociation") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.party_attorney_association_id = party_attorney_association_id - self.attorney_id = attorney_id - self.party_id = party_id - self.is_visible = is_visible - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, party_attorney_association_id, attorney_id, party_id, is_visible, *args, **kwargs): # noqa: E501 - """PartyAttorneyAssociation - a model defined in OpenAPI - - Args: - party_attorney_association_id (str): ID of the association - attorney_id (str): ID for the attorney in this case. This ID is unique within a case and NOT across cases. If the same attorney were to appear in another case this ID would be different. - party_id (str): ID for the party in this case. This ID is unique within a case and NOT across cases. If the same attorney were to appear in another case this ID would be different. - is_visible (bool): Signifies if this party attorney relationship is currently isVisible or not for the case. - - Keyword Args: - object (str): Name of the object. defaults to "PartyAttorneyAssociation" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartyAttorneyAssociation from a dict""" + if obj is None: + return None - object = kwargs.get('object', "PartyAttorneyAssociation") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PartyAttorneyAssociation', + "partyAttorneyAssociationId": obj.get("partyAttorneyAssociationId"), + "attorneyId": obj.get("attorneyId"), + "partyId": obj.get("partyId"), + "isVisible": obj.get("isVisible") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.party_attorney_association_id = party_attorney_association_id - self.attorney_id = attorney_id - self.party_id = party_id - self.is_visible = is_visible - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/party_attorney_associations.py b/unicourt/model/party_attorney_associations.py index 1bd6bc3..d5ccb5c 100644 --- a/unicourt/model/party_attorney_associations.py +++ b/unicourt/model/party_attorney_associations.py @@ -1,317 +1,111 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.party_attorney_association import PartyAttorneyAssociation - globals()['PartyAttorneyAssociation'] = PartyAttorneyAssociation +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class PartyAttorneyAssociations(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.party_attorney_association import PartyAttorneyAssociation +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PartyAttorneyAssociations(BaseModel): """ + PartyAttorneyAssociations + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default='PartyAttorneyAssociations', description="Name of the object") + page_number: Optional[StrictInt] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + party_attorney_association_array: Optional[Annotated[List[PartyAttorneyAssociation], Field(max_length=25)]] = Field(default=None, alias="partyAttorneyAssociationArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to next page of a particular entity in a Case.", alias="nextPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects of a party in the Case.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of parties of the Case entity in a Case.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "pageNumber", "partyAttorneyAssociationArray", "nextPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 25, - 'min_length': 25, - }, - ('party_attorney_association_array',): { - 'max_items': 25, - }, - ('next_page_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PartyAttorneyAssociations from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'party_attorney_association_array': ([PartyAttorneyAssociation],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'party_attorney_association_array': 'partyAttorneyAssociationArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in party_attorney_association_array (list) + _items = [] + if self.party_attorney_association_array: + for _item in self.party_attorney_association_array: + if _item: + _items.append(_item.to_dict()) + _dict['partyAttorneyAssociationArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, page_number, party_attorney_association_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """PartyAttorneyAssociations - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - party_attorney_association_array ([PartyAttorneyAssociation]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "PartyAttorneyAssociations" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PartyAttorneyAssociations") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.page_number = page_number - self.party_attorney_association_array = party_attorney_association_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, page_number, party_attorney_association_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """PartyAttorneyAssociations - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - party_attorney_association_array ([PartyAttorneyAssociation]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "PartyAttorneyAssociations" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartyAttorneyAssociations from a dict""" + if obj is None: + return None - object = kwargs.get('object', "PartyAttorneyAssociations") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PartyAttorneyAssociations', + "pageNumber": obj.get("pageNumber"), + "partyAttorneyAssociationArray": [PartyAttorneyAssociation.from_dict(_item) for _item in obj["partyAttorneyAssociationArray"]] if obj.get("partyAttorneyAssociationArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.page_number = page_number - self.party_attorney_association_array = party_attorney_association_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/party_role.py b/unicourt/model/party_role.py index 68e8c85..9a78533 100644 --- a/unicourt/model/party_role.py +++ b/unicourt/model/party_role.py @@ -1,335 +1,106 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class PartyRole(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PartyRole(BaseModel): """ + PartyRole + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]] = 'PartyRole' + party_role_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="partyRoleId") + party_role_group_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="partyRoleGroupId") + party_role_group: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, alias="partyRoleGroup") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + description: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "partyRoleId", "partyRoleGroupId", "partyRoleGroup", "name", "description", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 9, - 'min_length': 9, - }, - ('party_role_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('party_role_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('party_role_group',): { - 'max_length': 255, - 'min_length': 1, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('description',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PartyRole from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'party_role_id': (str,), # noqa: E501 - 'party_role_group_id': (str,), # noqa: E501 - 'party_role_group': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'description': (str, none_type,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - + excluded_fields: Set[str] = set([ + ]) - attribute_map = { - 'object': 'object', # noqa: E501 - 'party_role_id': 'partyRoleId', # noqa: E501 - 'party_role_group_id': 'partyRoleGroupId', # noqa: E501 - 'party_role_group': 'partyRoleGroup', # noqa: E501 - 'name': 'name', # noqa: E501 - 'description': 'description', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None - read_only_vars = { - } - - _composed_schemas = {} + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, party_role_id, party_role_group_id, party_role_group, name, description, created_date, *args, **kwargs): # noqa: E501 - """PartyRole - a model defined in OpenAPI - - Args: - party_role_id (str): - party_role_group_id (str): - party_role_group (str): - name (str): - description (str, none_type): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "PartyRole" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PartyRole") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.party_role_id = party_role_id - self.party_role_group_id = party_role_group_id - self.party_role_group = party_role_group - self.name = name - self.description = description - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, party_role_id, party_role_group_id, party_role_group, name, description, created_date, *args, **kwargs): # noqa: E501 - """PartyRole - a model defined in OpenAPI - - Args: - party_role_id (str): - party_role_group_id (str): - party_role_group (str): - name (str): - description (str, none_type): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "PartyRole" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PartyRole") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartyRole from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PartyRole', + "partyRoleId": obj.get("partyRoleId"), + "partyRoleGroupId": obj.get("partyRoleGroupId"), + "partyRoleGroup": obj.get("partyRoleGroup"), + "name": obj.get("name"), + "description": obj.get("description"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.party_role_id = party_role_id - self.party_role_group_id = party_role_group_id - self.party_role_group = party_role_group - self.name = name - self.description = description - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/party_role_group.py b/unicourt/model/party_role_group.py index 3baa6e0..6486061 100644 --- a/unicourt/model/party_role_group.py +++ b/unicourt/model/party_role_group.py @@ -1,315 +1,102 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class PartyRoleGroup(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PartyRoleGroup(BaseModel): """ + PartyRoleGroup + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=14, strict=True, max_length=14)]] = 'PartyRoleGroup' + party_role_group_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="partyRoleGroupId") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + description: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + created_date: Optional[datetime] = Field(default=None, description="The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS.", alias="createdDate") + __properties: ClassVar[List[str]] = ["object", "partyRoleGroupId", "name", "description", "createdDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 14, - 'min_length': 14, - }, - ('party_role_group_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('name',): { - 'max_length': 255, - 'min_length': 1, - }, - ('description',): { - 'max_length': 255, - 'min_length': 1, - }, - ('created_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PartyRoleGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'party_role_group_id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'description': (str, none_type,), # noqa: E501 - 'created_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None - attribute_map = { - 'object': 'object', # noqa: E501 - 'party_role_group_id': 'partyRoleGroupId', # noqa: E501 - 'name': 'name', # noqa: E501 - 'description': 'description', # noqa: E501 - 'created_date': 'createdDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, party_role_group_id, name, description, created_date, *args, **kwargs): # noqa: E501 - """PartyRoleGroup - a model defined in OpenAPI - - Args: - party_role_group_id (str): - name (str): - description (str, none_type): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "PartyRoleGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PartyRoleGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.party_role_group_id = party_role_group_id - self.name = name - self.description = description - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, party_role_group_id, name, description, created_date, *args, **kwargs): # noqa: E501 - """PartyRoleGroup - a model defined in OpenAPI - - Args: - party_role_group_id (str): - name (str): - description (str, none_type): - created_date (datetime): The date and time when it was first created. This date and time is in UTC. Formatted as YYYY-MM-DD HH:MM:SS. - - Keyword Args: - object (str): defaults to "PartyRoleGroup" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartyRoleGroup from a dict""" + if obj is None: + return None - object = kwargs.get('object', "PartyRoleGroup") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PartyRoleGroup', + "partyRoleGroupId": obj.get("partyRoleGroupId"), + "name": obj.get("name"), + "description": obj.get("description"), + "createdDate": obj.get("createdDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.party_role_group_id = party_role_group_id - self.name = name - self.description = description - self.created_date = created_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/party_role_group_response.py b/unicourt/model/party_role_group_response.py index d6bfbc9..ec587c5 100644 --- a/unicourt/model/party_role_group_response.py +++ b/unicourt/model/party_role_group_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.party_role_group import PartyRoleGroup - globals()['PartyRoleGroup'] = PartyRoleGroup - - -class PartyRoleGroupResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 22, - 'min_length': 22, - }, - ('party_role_group_array',): { - }, - ('next_page_api',): { - 'max_length': 2147, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2146, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'party_role_group_array': ([PartyRoleGroup],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'party_role_group_array': 'partyRoleGroupArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.party_role_group import PartyRoleGroup +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class PartyRoleGroupResponse(BaseModel): + """ + PartyRoleGroupResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=22, strict=True, max_length=22)]] = 'PartyRoleGroupResponse' + party_role_group_array: Optional[List[PartyRoleGroup]] = Field(default=None, alias="partyRoleGroupArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2147)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2146)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "partyRoleGroupArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, party_role_group_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """PartyRoleGroupResponse - a model defined in OpenAPI - - Args: - party_role_group_array ([PartyRoleGroup]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "PartyRoleGroupResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PartyRoleGroupResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PartyRoleGroupResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.party_role_group_array = party_role_group_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, party_role_group_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """PartyRoleGroupResponse - a model defined in OpenAPI - - Args: - party_role_group_array ([PartyRoleGroup]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "PartyRoleGroupResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in party_role_group_array (list) + _items = [] + if self.party_role_group_array: + for _item in self.party_role_group_array: + if _item: + _items.append(_item.to_dict()) + _dict['partyRoleGroupArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "PartyRoleGroupResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartyRoleGroupResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PartyRoleGroupResponse', + "partyRoleGroupArray": [PartyRoleGroup.from_dict(_item) for _item in obj["partyRoleGroupArray"]] if obj.get("partyRoleGroupArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.party_role_group_array = party_role_group_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/party_role_response.py b/unicourt/model/party_role_response.py index 1593349..a77ced0 100644 --- a/unicourt/model/party_role_response.py +++ b/unicourt/model/party_role_response.py @@ -1,333 +1,118 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.party_role import PartyRole - globals()['PartyRole'] = PartyRole - - -class PartyRoleResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 17, - 'min_length': 17, - }, - ('party_role_array',): { - }, - ('next_page_api',): { - 'max_length': 2142, - 'min_length': 1, - }, - ('previous_page_api',): { - 'max_length': 2141, - 'min_length': 1, - }, - ('page_number',): { - }, - ('total_pages',): { - }, - ('total_count',): { - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'party_role_array': ([PartyRole],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'previous_page_api': (str, none_type,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'party_role_array': 'partyRoleArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'previous_page_api': 'previousPageAPI', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.party_role import PartyRole +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class PartyRoleResponse(BaseModel): + """ + PartyRoleResponse + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=17)]] = 'PartyRoleResponse' + party_role_array: Optional[List[PartyRole]] = Field(default=None, alias="partyRoleArray") + next_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2142)]] = Field(default=None, description="Link to next page.", alias="nextPageAPI") + previous_page_api: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2141)]] = Field(default=None, description="Link to previous page.", alias="previousPageAPI") + page_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of matches found.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "partyRoleArray", "nextPageAPI", "previousPageAPI", "pageNumber", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, party_role_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """PartyRoleResponse - a model defined in OpenAPI - - Args: - party_role_array ([PartyRole]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "PartyRoleResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PartyRoleResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PartyRoleResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.party_role_array = party_role_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, party_role_array, next_page_api, previous_page_api, page_number, total_pages, total_count, *args, **kwargs): # noqa: E501 - """PartyRoleResponse - a model defined in OpenAPI - - Args: - party_role_array ([PartyRole]): - next_page_api (str, none_type): Link to next page. - previous_page_api (str, none_type): Link to previous page. - page_number (int): Page number for which results where obtained. - total_pages (int): Total number of pages to obtain all the objects. - total_count (int): Total number of matches found. - - Keyword Args: - object (str): defaults to "PartyRoleResponse" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in party_role_array (list) + _items = [] + if self.party_role_array: + for _item in self.party_role_array: + if _item: + _items.append(_item.to_dict()) + _dict['partyRoleArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + # set to None if previous_page_api (nullable) is None + # and model_fields_set contains the field + if self.previous_page_api is None and "previous_page_api" in self.model_fields_set: + _dict['previousPageAPI'] = None + + return _dict - object = kwargs.get('object', "PartyRoleResponse") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartyRoleResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PartyRoleResponse', + "partyRoleArray": [PartyRole.from_dict(_item) for _item in obj["partyRoleArray"]] if obj.get("partyRoleArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "previousPageAPI": obj.get("previousPageAPI"), + "pageNumber": obj.get("pageNumber"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.party_role_array = party_role_array - self.next_page_api = next_page_api - self.previous_page_api = previous_page_api - self.page_number = page_number - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/pcl_case.py b/unicourt/model/pcl_case.py index ae7c4c1..28aa509 100644 --- a/unicourt/model/pcl_case.py +++ b/unicourt/model/pcl_case.py @@ -1,330 +1,123 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.pacer_case_search_results import PACERCaseSearchResults - from unicourt.model.pacer_search_page_info import PACERSearchPageInfo - from unicourt.model.pacer_search_receipt import PACERSearchReceipt - globals()['PACERCaseSearchResults'] = PACERCaseSearchResults - globals()['PACERSearchPageInfo'] = PACERSearchPageInfo - globals()['PACERSearchReceipt'] = PACERSearchReceipt - - -class PCLCase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 7, - 'min_length': 7, - }, - ('next_page_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'pacer_receipt': (PACERSearchReceipt,), # noqa: E501 - 'pacer_page_info': (PACERSearchPageInfo,), # noqa: E501 - 'pacer_search_results_array': ([PACERCaseSearchResults],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'pacer_receipt': 'pacerReceipt', # noqa: E501 - 'pacer_page_info': 'pacerPageInfo', # noqa: E501 - 'pacer_search_results_array': 'pacerSearchResultsArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.pacer_case_search_results import PACERCaseSearchResults +from unicourt.model.pacer_search_page_info import PACERSearchPageInfo +from unicourt.model.pacer_search_receipt import PACERSearchReceipt +from typing import Optional, Set +from typing_extensions import Self + +class PCLCase(BaseModel): + """ + PCLCase + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=7)]] = Field(default='PCLCase', description="Name of the object") + page_number: Optional[StrictInt] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + pacer_receipt: Optional[PACERSearchReceipt] = Field(default=None, alias="pacerReceipt") + pacer_page_info: Optional[PACERSearchPageInfo] = Field(default=None, alias="pacerPageInfo") + pacer_search_results_array: Optional[List[PACERCaseSearchResults]] = Field(default=None, alias="pacerSearchResultsArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=1000000)]] = Field(default=None, description="Link to next page of the PCL Search Results.", alias="nextPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects the current PCL Search.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of records available for this Search.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "pageNumber", "pacerReceipt", "pacerPageInfo", "pacerSearchResultsArray", "nextPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, page_number, pacer_receipt, pacer_page_info, pacer_search_results_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """PCLCase - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PCLCase from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - page_number (int): Page number for which results where obtained. - pacer_receipt (PACERSearchReceipt): - pacer_page_info (PACERSearchPageInfo): - pacer_search_results_array ([PACERCaseSearchResults]): - next_page_api (str, none_type): Link to next page of the PCL Search Results. - total_pages (int): Total number of pages to obtain all the objects the current PCL Search. - total_count (int): Total number of records available for this Search. - - Keyword Args: - object (str): Name of the object. defaults to "PCLCase" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "PCLCase") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.page_number = page_number - self.pacer_receipt = pacer_receipt - self.pacer_page_info = pacer_page_info - self.pacer_search_results_array = pacer_search_results_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, page_number, pacer_receipt, pacer_page_info, pacer_search_results_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """PCLCase - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - pacer_receipt (PACERSearchReceipt): - pacer_page_info (PACERSearchPageInfo): - pacer_search_results_array ([PACERCaseSearchResults]): - next_page_api (str, none_type): Link to next page of the PCL Search Results. - total_pages (int): Total number of pages to obtain all the objects the current PCL Search. - total_count (int): Total number of records available for this Search. - - Keyword Args: - object (str): Name of the object. defaults to "PCLCase" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pacer_receipt + if self.pacer_receipt: + _dict['pacerReceipt'] = self.pacer_receipt.to_dict() + # override the default output from pydantic by calling `to_dict()` of pacer_page_info + if self.pacer_page_info: + _dict['pacerPageInfo'] = self.pacer_page_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in pacer_search_results_array (list) + _items = [] + if self.pacer_search_results_array: + for _item in self.pacer_search_results_array: + if _item: + _items.append(_item.to_dict()) + _dict['pacerSearchResultsArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + return _dict - object = kwargs.get('object', "PCLCase") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PCLCase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PCLCase', + "pageNumber": obj.get("pageNumber"), + "pacerReceipt": PACERSearchReceipt.from_dict(obj["pacerReceipt"]) if obj.get("pacerReceipt") is not None else None, + "pacerPageInfo": PACERSearchPageInfo.from_dict(obj["pacerPageInfo"]) if obj.get("pacerPageInfo") is not None else None, + "pacerSearchResultsArray": [PACERCaseSearchResults.from_dict(_item) for _item in obj["pacerSearchResultsArray"]] if obj.get("pacerSearchResultsArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.page_number = page_number - self.pacer_receipt = pacer_receipt - self.pacer_page_info = pacer_page_info - self.pacer_search_results_array = pacer_search_results_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/pcl_party.py b/unicourt/model/pcl_party.py index 9388ae3..37023cd 100644 --- a/unicourt/model/pcl_party.py +++ b/unicourt/model/pcl_party.py @@ -1,330 +1,123 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.pacer_party_search_results import PACERPartySearchResults - from unicourt.model.pacer_search_page_info import PACERSearchPageInfo - from unicourt.model.pacer_search_receipt import PACERSearchReceipt - globals()['PACERPartySearchResults'] = PACERPartySearchResults - globals()['PACERSearchPageInfo'] = PACERSearchPageInfo - globals()['PACERSearchReceipt'] = PACERSearchReceipt - - -class PCLParty(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 8, - 'min_length': 8, - }, - ('next_page_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'pacer_receipt': (PACERSearchReceipt,), # noqa: E501 - 'pacer_page_info': (PACERSearchPageInfo,), # noqa: E501 - 'pacer_search_results_array': ([PACERPartySearchResults],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'pacer_receipt': 'pacerReceipt', # noqa: E501 - 'pacer_page_info': 'pacerPageInfo', # noqa: E501 - 'pacer_search_results_array': 'pacerSearchResultsArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.pacer_party_search_results import PACERPartySearchResults +from unicourt.model.pacer_search_page_info import PACERSearchPageInfo +from unicourt.model.pacer_search_receipt import PACERSearchReceipt +from typing import Optional, Set +from typing_extensions import Self + +class PCLParty(BaseModel): + """ + PCLParty + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=8, strict=True, max_length=8)]] = Field(default='PCLParty', description="Name of the object") + page_number: Optional[StrictInt] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + pacer_receipt: Optional[PACERSearchReceipt] = Field(default=None, alias="pacerReceipt") + pacer_page_info: Optional[PACERSearchPageInfo] = Field(default=None, alias="pacerPageInfo") + pacer_search_results_array: Optional[List[PACERPartySearchResults]] = Field(default=None, alias="pacerSearchResultsArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=1000000)]] = Field(default=None, description="Link to next page of the PCL Search Results.", alias="nextPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects the current PCL Search.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of records available for this Search.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "pageNumber", "pacerReceipt", "pacerPageInfo", "pacerSearchResultsArray", "nextPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, page_number, pacer_receipt, pacer_page_info, pacer_search_results_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """PCLParty - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PCLParty from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - page_number (int): Page number for which results where obtained. - pacer_receipt (PACERSearchReceipt): - pacer_page_info (PACERSearchPageInfo): - pacer_search_results_array ([PACERPartySearchResults]): - next_page_api (str, none_type): Link to next page of the PCL Search Results. - total_pages (int): Total number of pages to obtain all the objects the current PCL Search. - total_count (int): Total number of records available for this Search. - - Keyword Args: - object (str): Name of the object. defaults to "PCLParty" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "PCLParty") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.page_number = page_number - self.pacer_receipt = pacer_receipt - self.pacer_page_info = pacer_page_info - self.pacer_search_results_array = pacer_search_results_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, page_number, pacer_receipt, pacer_page_info, pacer_search_results_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """PCLParty - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - pacer_receipt (PACERSearchReceipt): - pacer_page_info (PACERSearchPageInfo): - pacer_search_results_array ([PACERPartySearchResults]): - next_page_api (str, none_type): Link to next page of the PCL Search Results. - total_pages (int): Total number of pages to obtain all the objects the current PCL Search. - total_count (int): Total number of records available for this Search. - - Keyword Args: - object (str): Name of the object. defaults to "PCLParty" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pacer_receipt + if self.pacer_receipt: + _dict['pacerReceipt'] = self.pacer_receipt.to_dict() + # override the default output from pydantic by calling `to_dict()` of pacer_page_info + if self.pacer_page_info: + _dict['pacerPageInfo'] = self.pacer_page_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in pacer_search_results_array (list) + _items = [] + if self.pacer_search_results_array: + for _item in self.pacer_search_results_array: + if _item: + _items.append(_item.to_dict()) + _dict['pacerSearchResultsArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + return _dict - object = kwargs.get('object', "PCLParty") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PCLParty from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PCLParty', + "pageNumber": obj.get("pageNumber"), + "pacerReceipt": PACERSearchReceipt.from_dict(obj["pacerReceipt"]) if obj.get("pacerReceipt") is not None else None, + "pacerPageInfo": PACERSearchPageInfo.from_dict(obj["pacerPageInfo"]) if obj.get("pacerPageInfo") is not None else None, + "pacerSearchResultsArray": [PACERPartySearchResults.from_dict(_item) for _item in obj["pacerSearchResultsArray"]] if obj.get("pacerSearchResultsArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.page_number = page_number - self.pacer_receipt = pacer_receipt - self.pacer_page_info = pacer_page_info - self.pacer_search_results_array = pacer_search_results_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/phone.py b/unicourt/model/phone.py index 8c81ad7..c552be3 100644 --- a/unicourt/model/phone.py +++ b/unicourt/model/phone.py @@ -1,327 +1,109 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class Phone(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class Phone(BaseModel): """ + Phone object data schema. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=5, strict=True, max_length=5)]] = 'Phone' + phone_number: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=30)]] = Field(default=None, description="Phone Number", alias="phoneNumber") + phone_type: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=250)]] = Field(default=None, description="Resolved phone type (ideally from master data).", alias="phoneType") + is_visible: Optional[StrictBool] = Field(default=None, description="Boolean indicating if the phone is visible or not.", alias="isVisible") + first_fetch_date: Optional[datetime] = Field(default=None, description="Date at which this record is created in UniCourt.", alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, description="Date at which this record was updated in UniCourt.", alias="lastFetchDate") + __properties: ClassVar[List[str]] = ["object", "phoneNumber", "phoneType", "isVisible", "firstFetchDate", "lastFetchDate"] + + @field_validator('phone_type') + def phone_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['DEFAULT', 'OFFICE', 'FAX', 'PHONE']): + raise ValueError("must be one of enum values ('DEFAULT', 'OFFICE', 'FAX', 'PHONE')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('phone_type',): { - 'DEFAULT': "DEFAULT", - 'OFFICE': "OFFICE", - 'FAX': "FAX", - 'PHONE': "PHONE", - }, - } - - validations = { - ('object',): { - 'max_length': 5, - 'min_length': 5, - }, - ('phone_number',): { - 'max_length': 30, - 'min_length': 1, - }, - ('phone_type',): { - 'max_length': 250, - 'min_length': 1, - }, - ('first_fetch_date',): { - 'max_length': 35, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 35, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Phone from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'phone_number': (str,), # noqa: E501 - 'phone_type': (str,), # noqa: E501 - 'is_visible': (bool,), # noqa: E501 - 'first_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'phone_number': 'phoneNumber', # noqa: E501 - 'phone_type': 'phoneType', # noqa: E501 - 'is_visible': 'isVisible', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, phone_number, phone_type, is_visible, first_fetch_date, last_fetch_date, *args, **kwargs): # noqa: E501 - """Phone - a model defined in OpenAPI - - Args: - phone_number (str): Phone Number - phone_type (str): Resolved phone type (ideally from master data). - is_visible (bool): Boolean indicating if the phone is visible or not. - first_fetch_date (datetime): Date at which this record is created in UniCourt. - last_fetch_date (datetime): Date at which this record was updated in UniCourt. - - Keyword Args: - object (str): defaults to "Phone" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "Phone") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.phone_number = phone_number - self.phone_type = phone_type - self.is_visible = is_visible - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, phone_number, phone_type, is_visible, first_fetch_date, last_fetch_date, *args, **kwargs): # noqa: E501 - """Phone - a model defined in OpenAPI - - Args: - phone_number (str): Phone Number - phone_type (str): Resolved phone type (ideally from master data). - is_visible (bool): Boolean indicating if the phone is visible or not. - first_fetch_date (datetime): Date at which this record is created in UniCourt. - last_fetch_date (datetime): Date at which this record was updated in UniCourt. - - Keyword Args: - object (str): defaults to "Phone" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Phone from a dict""" + if obj is None: + return None - object = kwargs.get('object', "Phone") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Phone', + "phoneNumber": obj.get("phoneNumber"), + "phoneType": obj.get("phoneType"), + "isVisible": obj.get("isVisible"), + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.phone_number = phone_number - self.phone_type = phone_type - self.is_visible = is_visible - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/possible_norm_attorney.py b/unicourt/model/possible_norm_attorney.py index 0cdd56f..fb6834d 100644 --- a/unicourt/model/possible_norm_attorney.py +++ b/unicourt/model/possible_norm_attorney.py @@ -1,374 +1,114 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.possible_norm_attorney_score_constituents import PossibleNormAttorneyScoreConstituents - globals()['PossibleNormAttorneyScoreConstituents'] = PossibleNormAttorneyScoreConstituents - - -class PossibleNormAttorney(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 20, - 'min_length': 20, - }, - ('norm_attorney_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('norm_attorney_name',): { - 'max_length': 500, - }, - ('norm_attorney_api',): { - 'max_length': 255, - }, - ('associated_norm_judges_api',): { - 'max_length': 255, - }, - ('associated_norm_law_firms_api',): { - 'max_length': 255, - }, - ('associated_norm_parties_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_norm_attorney_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_opposing_norm_attorney_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_attorney_id': (str,), # noqa: E501 - 'norm_attorney_name': (str,), # noqa: E501 - 'best_match': (bool,), # noqa: E501 - 'confidence_score': (float,), # noqa: E501 - 'score_constituents': (PossibleNormAttorneyScoreConstituents,), # noqa: E501 - 'norm_attorney_api': (str,), # noqa: E501 - 'associated_norm_judges_api': (str,), # noqa: E501 - 'associated_norm_law_firms_api': (str,), # noqa: E501 - 'associated_norm_parties_api': (str,), # noqa: E501 - 'case_count_analytics_by_norm_attorney_api': (str,), # noqa: E501 - 'case_count_analytics_by_opposing_norm_attorney_api': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_attorney_id': 'normAttorneyId', # noqa: E501 - 'norm_attorney_name': 'normAttorneyName', # noqa: E501 - 'best_match': 'bestMatch', # noqa: E501 - 'confidence_score': 'confidenceScore', # noqa: E501 - 'score_constituents': 'scoreConstituents', # noqa: E501 - 'norm_attorney_api': 'normAttorneyAPI', # noqa: E501 - 'associated_norm_judges_api': 'associatedNormJudgesAPI', # noqa: E501 - 'associated_norm_law_firms_api': 'associatedNormLawFirmsAPI', # noqa: E501 - 'associated_norm_parties_api': 'associatedNormPartiesAPI', # noqa: E501 - 'case_count_analytics_by_norm_attorney_api': 'caseCountAnalyticsByNormAttorneyAPI', # noqa: E501 - 'case_count_analytics_by_opposing_norm_attorney_api': 'caseCountAnalyticsByOpposingNormAttorneyAPI', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from unicourt.model.possible_norm_attorney_score_constituents import PossibleNormAttorneyScoreConstituents +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class PossibleNormAttorney(BaseModel): + """ + PossibleNormAttorney + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=20, strict=True, max_length=20)]] = Field(default='PossibleNormAttorney', description="Name of the object") + norm_attorney_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normAttorneyId") + norm_attorney_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="normAttorneyName") + best_match: Optional[StrictBool] = Field(default=False, alias="bestMatch") + confidence_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="confidenceScore") + score_constituents: Optional[PossibleNormAttorneyScoreConstituents] = Field(default=None, alias="scoreConstituents") + norm_attorney_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="normAttorneyAPI") + associated_norm_judges_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormJudgesAPI") + associated_norm_law_firms_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormLawFirmsAPI") + associated_norm_parties_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormPartiesAPI") + case_count_analytics_by_norm_attorney_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByNormAttorneyAPI") + case_count_analytics_by_opposing_norm_attorney_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByOpposingNormAttorneyAPI") + __properties: ClassVar[List[str]] = ["object", "normAttorneyId", "normAttorneyName", "bestMatch", "confidenceScore", "scoreConstituents", "normAttorneyAPI", "associatedNormJudgesAPI", "associatedNormLawFirmsAPI", "associatedNormPartiesAPI", "caseCountAnalyticsByNormAttorneyAPI", "caseCountAnalyticsByOpposingNormAttorneyAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_attorney_id, norm_attorney_name, confidence_score, score_constituents, norm_attorney_api, associated_norm_judges_api, associated_norm_law_firms_api, associated_norm_parties_api, case_count_analytics_by_norm_attorney_api, case_count_analytics_by_opposing_norm_attorney_api, *args, **kwargs): # noqa: E501 - """PossibleNormAttorney - a model defined in OpenAPI - - Args: - norm_attorney_id (str): - norm_attorney_name (str): - confidence_score (float): - score_constituents (PossibleNormAttorneyScoreConstituents): - norm_attorney_api (str): - associated_norm_judges_api (str): - associated_norm_law_firms_api (str): - associated_norm_parties_api (str): - case_count_analytics_by_norm_attorney_api (str): - case_count_analytics_by_opposing_norm_attorney_api (str): - - Keyword Args: - object (str): Name of the object. defaults to "PossibleNormAttorney" # noqa: E501 - best_match (bool): defaults to False # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PossibleNormAttorney") - best_match = kwargs.get('best_match', False) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PossibleNormAttorney from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_attorney_id = norm_attorney_id - self.norm_attorney_name = norm_attorney_name - self.best_match = best_match - self.confidence_score = confidence_score - self.score_constituents = score_constituents - self.norm_attorney_api = norm_attorney_api - self.associated_norm_judges_api = associated_norm_judges_api - self.associated_norm_law_firms_api = associated_norm_law_firms_api - self.associated_norm_parties_api = associated_norm_parties_api - self.case_count_analytics_by_norm_attorney_api = case_count_analytics_by_norm_attorney_api - self.case_count_analytics_by_opposing_norm_attorney_api = case_count_analytics_by_opposing_norm_attorney_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_attorney_id, norm_attorney_name, confidence_score, score_constituents, norm_attorney_api, associated_norm_judges_api, associated_norm_law_firms_api, associated_norm_parties_api, case_count_analytics_by_norm_attorney_api, case_count_analytics_by_opposing_norm_attorney_api, *args, **kwargs): # noqa: E501 - """PossibleNormAttorney - a model defined in OpenAPI - - Args: - norm_attorney_id (str): - norm_attorney_name (str): - confidence_score (float): - score_constituents (PossibleNormAttorneyScoreConstituents): - norm_attorney_api (str): - associated_norm_judges_api (str): - associated_norm_law_firms_api (str): - associated_norm_parties_api (str): - case_count_analytics_by_norm_attorney_api (str): - case_count_analytics_by_opposing_norm_attorney_api (str): - - Keyword Args: - object (str): Name of the object. defaults to "PossibleNormAttorney" # noqa: E501 - best_match (bool): defaults to False # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of score_constituents + if self.score_constituents: + _dict['scoreConstituents'] = self.score_constituents.to_dict() + return _dict - object = kwargs.get('object', "PossibleNormAttorney") - best_match = kwargs.get('best_match', False) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PossibleNormAttorney from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PossibleNormAttorney', + "normAttorneyId": obj.get("normAttorneyId"), + "normAttorneyName": obj.get("normAttorneyName"), + "bestMatch": obj.get("bestMatch") if obj.get("bestMatch") is not None else False, + "confidenceScore": obj.get("confidenceScore"), + "scoreConstituents": PossibleNormAttorneyScoreConstituents.from_dict(obj["scoreConstituents"]) if obj.get("scoreConstituents") is not None else None, + "normAttorneyAPI": obj.get("normAttorneyAPI"), + "associatedNormJudgesAPI": obj.get("associatedNormJudgesAPI"), + "associatedNormLawFirmsAPI": obj.get("associatedNormLawFirmsAPI"), + "associatedNormPartiesAPI": obj.get("associatedNormPartiesAPI"), + "caseCountAnalyticsByNormAttorneyAPI": obj.get("caseCountAnalyticsByNormAttorneyAPI"), + "caseCountAnalyticsByOpposingNormAttorneyAPI": obj.get("caseCountAnalyticsByOpposingNormAttorneyAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_attorney_id = norm_attorney_id - self.norm_attorney_name = norm_attorney_name - self.best_match = best_match - self.confidence_score = confidence_score - self.score_constituents = score_constituents - self.norm_attorney_api = norm_attorney_api - self.associated_norm_judges_api = associated_norm_judges_api - self.associated_norm_law_firms_api = associated_norm_law_firms_api - self.associated_norm_parties_api = associated_norm_parties_api - self.case_count_analytics_by_norm_attorney_api = case_count_analytics_by_norm_attorney_api - self.case_count_analytics_by_opposing_norm_attorney_api = case_count_analytics_by_opposing_norm_attorney_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/possible_norm_attorney_score_constituents.py b/unicourt/model/possible_norm_attorney_score_constituents.py index fc6f115..114886e 100644 --- a/unicourt/model/possible_norm_attorney_score_constituents.py +++ b/unicourt/model/possible_norm_attorney_score_constituents.py @@ -1,345 +1,150 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations +import pprint import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class PossibleNormAttorneyScoreConstituents(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PossibleNormAttorneyScoreConstituents(BaseModel): """ + PossibleNormAttorneyScoreConstituents + """ # noqa: E501 + name_similarity_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="nameSimilarityScore") + other_potential_norm_attorneys: Optional[StrictInt] = Field(default=None, alias="otherPotentialNormAttorneys") + bar_id: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="barId") + address: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + email: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + phone: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + law_firm: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="lawFirm") + __properties: ClassVar[List[str]] = ["nameSimilarityScore", "otherPotentialNormAttorneys", "barId", "address", "email", "phone", "lawFirm"] + + @field_validator('bar_id') + def bar_id_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + @field_validator('address') + def address_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + @field_validator('email') + def email_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + @field_validator('phone') + def phone_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + @field_validator('law_firm') + def law_firm_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('bar_id',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - ('address',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - ('email',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - ('phone',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - ('law_firm',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - } - - validations = { - ('bar_id',): { - 'max_length': 250, - }, - ('address',): { - 'max_length': 250, - }, - ('email',): { - 'max_length': 250, - }, - ('phone',): { - 'max_length': 250, - }, - ('law_firm',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PossibleNormAttorneyScoreConstituents from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'name_similarity_score': (float,), # noqa: E501 - 'other_potential_norm_attorneys': (int,), # noqa: E501 - 'bar_id': (str,), # noqa: E501 - 'address': (str,), # noqa: E501 - 'email': (str,), # noqa: E501 - 'phone': (str,), # noqa: E501 - 'law_firm': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'name_similarity_score': 'nameSimilarityScore', # noqa: E501 - 'other_potential_norm_attorneys': 'otherPotentialNormAttorneys', # noqa: E501 - 'bar_id': 'barId', # noqa: E501 - 'address': 'address', # noqa: E501 - 'email': 'email', # noqa: E501 - 'phone': 'phone', # noqa: E501 - 'law_firm': 'lawFirm', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name_similarity_score, other_potential_norm_attorneys, bar_id, address, email, phone, law_firm, *args, **kwargs): # noqa: E501 - """PossibleNormAttorneyScoreConstituents - a model defined in OpenAPI - - Args: - name_similarity_score (float): - other_potential_norm_attorneys (int): - bar_id (str): - address (str): - email (str): - phone (str): - law_firm (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PossibleNormAttorneyScoreConstituents from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "nameSimilarityScore": obj.get("nameSimilarityScore"), + "otherPotentialNormAttorneys": obj.get("otherPotentialNormAttorneys"), + "barId": obj.get("barId"), + "address": obj.get("address"), + "email": obj.get("email"), + "phone": obj.get("phone"), + "lawFirm": obj.get("lawFirm") + }) + return _obj - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name_similarity_score = name_similarity_score - self.other_potential_norm_attorneys = other_potential_norm_attorneys - self.bar_id = bar_id - self.address = address - self.email = email - self.phone = phone - self.law_firm = law_firm - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name_similarity_score, other_potential_norm_attorneys, bar_id, address, email, phone, law_firm, *args, **kwargs): # noqa: E501 - """PossibleNormAttorneyScoreConstituents - a model defined in OpenAPI - - Args: - name_similarity_score (float): - other_potential_norm_attorneys (int): - bar_id (str): - address (str): - email (str): - phone (str): - law_firm (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name_similarity_score = name_similarity_score - self.other_potential_norm_attorneys = other_potential_norm_attorneys - self.bar_id = bar_id - self.address = address - self.email = email - self.phone = phone - self.law_firm = law_firm - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/possible_norm_judge.py b/unicourt/model/possible_norm_judge.py index 6ff5676..005a62c 100644 --- a/unicourt/model/possible_norm_judge.py +++ b/unicourt/model/possible_norm_judge.py @@ -1,365 +1,117 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.possible_norm_judge_score_constituents import PossibleNormJudgeScoreConstituents - globals()['PossibleNormJudgeScoreConstituents'] = PossibleNormJudgeScoreConstituents - - -class PossibleNormJudge(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 17, - 'min_length': 17, - }, - ('norm_judge_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('norm_judge_name',): { - 'max_length': 500, - }, - ('norm_judge_api',): { - 'max_length': 255, - }, - ('associated_norm_attorneys_api',): { - 'max_length': 255, - }, - ('associated_norm_law_firms_api',): { - 'max_length': 255, - }, - ('associated_norm_parties_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_norm_judge_api',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_judge_id': (str,), # noqa: E501 - 'norm_judge_name': (str,), # noqa: E501 - 'best_match': (bool,), # noqa: E501 - 'confidence_score': (float, none_type,), # noqa: E501 - 'score_constituents': (PossibleNormJudgeScoreConstituents,), # noqa: E501 - 'norm_judge_api': (str,), # noqa: E501 - 'associated_norm_attorneys_api': (str,), # noqa: E501 - 'associated_norm_law_firms_api': (str,), # noqa: E501 - 'associated_norm_parties_api': (str,), # noqa: E501 - 'case_count_analytics_by_norm_judge_api': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_judge_id': 'normJudgeId', # noqa: E501 - 'norm_judge_name': 'normJudgeName', # noqa: E501 - 'best_match': 'bestMatch', # noqa: E501 - 'confidence_score': 'confidenceScore', # noqa: E501 - 'score_constituents': 'scoreConstituents', # noqa: E501 - 'norm_judge_api': 'normJudgeAPI', # noqa: E501 - 'associated_norm_attorneys_api': 'associatedNormAttorneysAPI', # noqa: E501 - 'associated_norm_law_firms_api': 'associatedNormLawFirmsAPI', # noqa: E501 - 'associated_norm_parties_api': 'associatedNormPartiesAPI', # noqa: E501 - 'case_count_analytics_by_norm_judge_api': 'caseCountAnalyticsByNormJudgeAPI', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from unicourt.model.possible_norm_judge_score_constituents import PossibleNormJudgeScoreConstituents +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class PossibleNormJudge(BaseModel): + """ + PossibleNormJudge + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=17)]] = Field(default='PossibleNormJudge', description="Name of the object") + norm_judge_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normJudgeId") + norm_judge_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="normJudgeName") + best_match: Optional[StrictBool] = Field(default=False, alias="bestMatch") + confidence_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="confidenceScore") + score_constituents: Optional[PossibleNormJudgeScoreConstituents] = Field(default=None, alias="scoreConstituents") + norm_judge_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to Details For the Judge.", alias="normJudgeAPI") + associated_norm_attorneys_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormAttorneysAPI") + associated_norm_law_firms_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormLawFirmsAPI") + associated_norm_parties_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormPartiesAPI") + case_count_analytics_by_norm_judge_api: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="caseCountAnalyticsByNormJudgeAPI") + __properties: ClassVar[List[str]] = ["object", "normJudgeId", "normJudgeName", "bestMatch", "confidenceScore", "scoreConstituents", "normJudgeAPI", "associatedNormAttorneysAPI", "associatedNormLawFirmsAPI", "associatedNormPartiesAPI", "caseCountAnalyticsByNormJudgeAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_judge_id, norm_judge_name, confidence_score, score_constituents, norm_judge_api, associated_norm_attorneys_api, associated_norm_law_firms_api, associated_norm_parties_api, case_count_analytics_by_norm_judge_api, *args, **kwargs): # noqa: E501 - """PossibleNormJudge - a model defined in OpenAPI - - Args: - norm_judge_id (str): - norm_judge_name (str): - confidence_score (float, none_type): - score_constituents (PossibleNormJudgeScoreConstituents): - norm_judge_api (str): Link to Details For the Judge. - associated_norm_attorneys_api (str): - associated_norm_law_firms_api (str): - associated_norm_parties_api (str): - case_count_analytics_by_norm_judge_api (str): - - Keyword Args: - object (str): Name of the object. defaults to "PossibleNormJudge" # noqa: E501 - best_match (bool): defaults to False # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PossibleNormJudge") - best_match = kwargs.get('best_match', False) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PossibleNormJudge from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_judge_id = norm_judge_id - self.norm_judge_name = norm_judge_name - self.best_match = best_match - self.confidence_score = confidence_score - self.score_constituents = score_constituents - self.norm_judge_api = norm_judge_api - self.associated_norm_attorneys_api = associated_norm_attorneys_api - self.associated_norm_law_firms_api = associated_norm_law_firms_api - self.associated_norm_parties_api = associated_norm_parties_api - self.case_count_analytics_by_norm_judge_api = case_count_analytics_by_norm_judge_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_judge_id, norm_judge_name, confidence_score, score_constituents, norm_judge_api, associated_norm_attorneys_api, associated_norm_law_firms_api, associated_norm_parties_api, case_count_analytics_by_norm_judge_api, *args, **kwargs): # noqa: E501 - """PossibleNormJudge - a model defined in OpenAPI - - Args: - norm_judge_id (str): - norm_judge_name (str): - confidence_score (float, none_type): - score_constituents (PossibleNormJudgeScoreConstituents): - norm_judge_api (str): Link to Details For the Judge. - associated_norm_attorneys_api (str): - associated_norm_law_firms_api (str): - associated_norm_parties_api (str): - case_count_analytics_by_norm_judge_api (str): - - Keyword Args: - object (str): Name of the object. defaults to "PossibleNormJudge" # noqa: E501 - best_match (bool): defaults to False # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of score_constituents + if self.score_constituents: + _dict['scoreConstituents'] = self.score_constituents.to_dict() + # set to None if confidence_score (nullable) is None + # and model_fields_set contains the field + if self.confidence_score is None and "confidence_score" in self.model_fields_set: + _dict['confidenceScore'] = None + + return _dict - object = kwargs.get('object', "PossibleNormJudge") - best_match = kwargs.get('best_match', False) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PossibleNormJudge from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PossibleNormJudge', + "normJudgeId": obj.get("normJudgeId"), + "normJudgeName": obj.get("normJudgeName"), + "bestMatch": obj.get("bestMatch") if obj.get("bestMatch") is not None else False, + "confidenceScore": obj.get("confidenceScore"), + "scoreConstituents": PossibleNormJudgeScoreConstituents.from_dict(obj["scoreConstituents"]) if obj.get("scoreConstituents") is not None else None, + "normJudgeAPI": obj.get("normJudgeAPI"), + "associatedNormAttorneysAPI": obj.get("associatedNormAttorneysAPI"), + "associatedNormLawFirmsAPI": obj.get("associatedNormLawFirmsAPI"), + "associatedNormPartiesAPI": obj.get("associatedNormPartiesAPI"), + "caseCountAnalyticsByNormJudgeAPI": obj.get("caseCountAnalyticsByNormJudgeAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_judge_id = norm_judge_id - self.norm_judge_name = norm_judge_name - self.best_match = best_match - self.confidence_score = confidence_score - self.score_constituents = score_constituents - self.norm_judge_api = norm_judge_api - self.associated_norm_attorneys_api = associated_norm_attorneys_api - self.associated_norm_law_firms_api = associated_norm_law_firms_api - self.associated_norm_parties_api = associated_norm_parties_api - self.case_count_analytics_by_norm_judge_api = case_count_analytics_by_norm_judge_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/possible_norm_judge_score_constituents.py b/unicourt/model/possible_norm_judge_score_constituents.py index 0c50738..4e7cc6c 100644 --- a/unicourt/model/possible_norm_judge_score_constituents.py +++ b/unicourt/model/possible_norm_judge_score_constituents.py @@ -1,317 +1,126 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class PossibleNormJudgeScoreConstituents(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PossibleNormJudgeScoreConstituents(BaseModel): """ + PossibleNormJudgeScoreConstituents + """ # noqa: E501 + name_similarity_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="nameSimilarityScore") + other_potential_norm_judges: Optional[StrictInt] = Field(default=None, alias="otherPotentialNormJudges") + address: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + email: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + phone: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["nameSimilarityScore", "otherPotentialNormJudges", "address", "email", "phone"] + + @field_validator('address') + def address_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + @field_validator('email') + def email_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + @field_validator('phone') + def phone_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('address',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - ('email',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - ('phone',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - } - - validations = { - ('address',): { - 'max_length': 250, - }, - ('email',): { - 'max_length': 250, - }, - ('phone',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PossibleNormJudgeScoreConstituents from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'name_similarity_score': (float,), # noqa: E501 - 'other_potential_norm_judges': (int,), # noqa: E501 - 'address': (str,), # noqa: E501 - 'email': (str,), # noqa: E501 - 'phone': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'name_similarity_score': 'nameSimilarityScore', # noqa: E501 - 'other_potential_norm_judges': 'otherPotentialNormJudges', # noqa: E501 - 'address': 'address', # noqa: E501 - 'email': 'email', # noqa: E501 - 'phone': 'phone', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name_similarity_score, other_potential_norm_judges, address, email, phone, *args, **kwargs): # noqa: E501 - """PossibleNormJudgeScoreConstituents - a model defined in OpenAPI - - Args: - name_similarity_score (float): - other_potential_norm_judges (int): - address (str): - email (str): - phone (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name_similarity_score = name_similarity_score - self.other_potential_norm_judges = other_potential_norm_judges - self.address = address - self.email = email - self.phone = phone - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name_similarity_score, other_potential_norm_judges, address, email, phone, *args, **kwargs): # noqa: E501 - """PossibleNormJudgeScoreConstituents - a model defined in OpenAPI - - Args: - name_similarity_score (float): - other_potential_norm_judges (int): - address (str): - email (str): - phone (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PossibleNormJudgeScoreConstituents from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "nameSimilarityScore": obj.get("nameSimilarityScore"), + "otherPotentialNormJudges": obj.get("otherPotentialNormJudges"), + "address": obj.get("address"), + "email": obj.get("email"), + "phone": obj.get("phone") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.name_similarity_score = name_similarity_score - self.other_potential_norm_judges = other_potential_norm_judges - self.address = address - self.email = email - self.phone = phone - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/possible_norm_law_firm.py b/unicourt/model/possible_norm_law_firm.py index e62e7d5..f2d5712 100644 --- a/unicourt/model/possible_norm_law_firm.py +++ b/unicourt/model/possible_norm_law_firm.py @@ -1,382 +1,120 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.possible_norm_law_firm_score_constituents import PossibleNormLawFirmScoreConstituents - from unicourt.model.possible_norm_law_firm_source_details import PossibleNormLawFirmSourceDetails - globals()['PossibleNormLawFirmScoreConstituents'] = PossibleNormLawFirmScoreConstituents - globals()['PossibleNormLawFirmSourceDetails'] = PossibleNormLawFirmSourceDetails - - -class PossibleNormLawFirm(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 19, - 'min_length': 19, - }, - ('norm_law_firm_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('norm_law_firm_name',): { - 'max_length': 500, - }, - ('norm_law_firm_api',): { - 'max_length': 255, - }, - ('associated_norm_attorney_api',): { - 'max_length': 255, - }, - ('associated_norm_judge_api',): { - 'max_length': 255, - }, - ('associated_norm_parties_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_norm_law_firm_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_opposing_norm_law_firm_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_law_firm_id': (str,), # noqa: E501 - 'norm_law_firm_name': (str,), # noqa: E501 - 'best_match': (bool,), # noqa: E501 - 'source_details': (PossibleNormLawFirmSourceDetails,), # noqa: E501 - 'confidence_score': (float,), # noqa: E501 - 'score_constituents': (PossibleNormLawFirmScoreConstituents,), # noqa: E501 - 'norm_law_firm_api': (str,), # noqa: E501 - 'associated_norm_attorney_api': (str,), # noqa: E501 - 'associated_norm_judge_api': (str,), # noqa: E501 - 'associated_norm_parties_api': (str,), # noqa: E501 - 'case_count_analytics_by_norm_law_firm_api': (str,), # noqa: E501 - 'case_count_analytics_by_opposing_norm_law_firm_api': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_law_firm_id': 'normLawFirmId', # noqa: E501 - 'norm_law_firm_name': 'normLawFirmName', # noqa: E501 - 'best_match': 'bestMatch', # noqa: E501 - 'source_details': 'sourceDetails', # noqa: E501 - 'confidence_score': 'confidenceScore', # noqa: E501 - 'score_constituents': 'scoreConstituents', # noqa: E501 - 'norm_law_firm_api': 'normLawFirmAPI', # noqa: E501 - 'associated_norm_attorney_api': 'associatedNormAttorneyAPI', # noqa: E501 - 'associated_norm_judge_api': 'associatedNormJudgeAPI', # noqa: E501 - 'associated_norm_parties_api': 'associatedNormPartiesAPI', # noqa: E501 - 'case_count_analytics_by_norm_law_firm_api': 'caseCountAnalyticsByNormLawFirmAPI', # noqa: E501 - 'case_count_analytics_by_opposing_norm_law_firm_api': 'caseCountAnalyticsByOpposingNormLawFirmAPI', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from unicourt.model.possible_norm_law_firm_score_constituents import PossibleNormLawFirmScoreConstituents +from unicourt.model.possible_norm_law_firm_source_details import PossibleNormLawFirmSourceDetails +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class PossibleNormLawFirm(BaseModel): + """ + PossibleNormLawFirm + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=19, strict=True, max_length=19)]] = Field(default='PossibleNormLawFirm', description="Name of the object") + norm_law_firm_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normLawFirmId") + norm_law_firm_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="normLawFirmName") + best_match: Optional[StrictBool] = Field(default=False, alias="bestMatch") + source_details: Optional[PossibleNormLawFirmSourceDetails] = Field(default=None, alias="sourceDetails") + confidence_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="confidenceScore") + score_constituents: Optional[PossibleNormLawFirmScoreConstituents] = Field(default=None, alias="scoreConstituents") + norm_law_firm_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="normLawFirmAPI") + associated_norm_attorney_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormAttorneyAPI") + associated_norm_judge_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormJudgeAPI") + associated_norm_parties_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormPartiesAPI") + case_count_analytics_by_norm_law_firm_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByNormLawFirmAPI") + case_count_analytics_by_opposing_norm_law_firm_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByOpposingNormLawFirmAPI") + __properties: ClassVar[List[str]] = ["object", "normLawFirmId", "normLawFirmName", "bestMatch", "sourceDetails", "confidenceScore", "scoreConstituents", "normLawFirmAPI", "associatedNormAttorneyAPI", "associatedNormJudgeAPI", "associatedNormPartiesAPI", "caseCountAnalyticsByNormLawFirmAPI", "caseCountAnalyticsByOpposingNormLawFirmAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_law_firm_id, norm_law_firm_name, source_details, confidence_score, score_constituents, norm_law_firm_api, associated_norm_attorney_api, associated_norm_judge_api, associated_norm_parties_api, case_count_analytics_by_norm_law_firm_api, case_count_analytics_by_opposing_norm_law_firm_api, *args, **kwargs): # noqa: E501 - """PossibleNormLawFirm - a model defined in OpenAPI - - Args: - norm_law_firm_id (str): - norm_law_firm_name (str): - source_details (PossibleNormLawFirmSourceDetails): - confidence_score (float): - score_constituents (PossibleNormLawFirmScoreConstituents): - norm_law_firm_api (str): - associated_norm_attorney_api (str): - associated_norm_judge_api (str): - associated_norm_parties_api (str): - case_count_analytics_by_norm_law_firm_api (str): - case_count_analytics_by_opposing_norm_law_firm_api (str): - - Keyword Args: - object (str): Name of the object. defaults to "PossibleNormLawFirm" # noqa: E501 - best_match (bool): defaults to False # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PossibleNormLawFirm") - best_match = kwargs.get('best_match', False) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PossibleNormLawFirm from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_law_firm_id = norm_law_firm_id - self.norm_law_firm_name = norm_law_firm_name - self.best_match = best_match - self.source_details = source_details - self.confidence_score = confidence_score - self.score_constituents = score_constituents - self.norm_law_firm_api = norm_law_firm_api - self.associated_norm_attorney_api = associated_norm_attorney_api - self.associated_norm_judge_api = associated_norm_judge_api - self.associated_norm_parties_api = associated_norm_parties_api - self.case_count_analytics_by_norm_law_firm_api = case_count_analytics_by_norm_law_firm_api - self.case_count_analytics_by_opposing_norm_law_firm_api = case_count_analytics_by_opposing_norm_law_firm_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_law_firm_id, norm_law_firm_name, source_details, confidence_score, score_constituents, norm_law_firm_api, associated_norm_attorney_api, associated_norm_judge_api, associated_norm_parties_api, case_count_analytics_by_norm_law_firm_api, case_count_analytics_by_opposing_norm_law_firm_api, *args, **kwargs): # noqa: E501 - """PossibleNormLawFirm - a model defined in OpenAPI - - Args: - norm_law_firm_id (str): - norm_law_firm_name (str): - source_details (PossibleNormLawFirmSourceDetails): - confidence_score (float): - score_constituents (PossibleNormLawFirmScoreConstituents): - norm_law_firm_api (str): - associated_norm_attorney_api (str): - associated_norm_judge_api (str): - associated_norm_parties_api (str): - case_count_analytics_by_norm_law_firm_api (str): - case_count_analytics_by_opposing_norm_law_firm_api (str): - - Keyword Args: - object (str): Name of the object. defaults to "PossibleNormLawFirm" # noqa: E501 - best_match (bool): defaults to False # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of source_details + if self.source_details: + _dict['sourceDetails'] = self.source_details.to_dict() + # override the default output from pydantic by calling `to_dict()` of score_constituents + if self.score_constituents: + _dict['scoreConstituents'] = self.score_constituents.to_dict() + return _dict - object = kwargs.get('object', "PossibleNormLawFirm") - best_match = kwargs.get('best_match', False) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PossibleNormLawFirm from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PossibleNormLawFirm', + "normLawFirmId": obj.get("normLawFirmId"), + "normLawFirmName": obj.get("normLawFirmName"), + "bestMatch": obj.get("bestMatch") if obj.get("bestMatch") is not None else False, + "sourceDetails": PossibleNormLawFirmSourceDetails.from_dict(obj["sourceDetails"]) if obj.get("sourceDetails") is not None else None, + "confidenceScore": obj.get("confidenceScore"), + "scoreConstituents": PossibleNormLawFirmScoreConstituents.from_dict(obj["scoreConstituents"]) if obj.get("scoreConstituents") is not None else None, + "normLawFirmAPI": obj.get("normLawFirmAPI"), + "associatedNormAttorneyAPI": obj.get("associatedNormAttorneyAPI"), + "associatedNormJudgeAPI": obj.get("associatedNormJudgeAPI"), + "associatedNormPartiesAPI": obj.get("associatedNormPartiesAPI"), + "caseCountAnalyticsByNormLawFirmAPI": obj.get("caseCountAnalyticsByNormLawFirmAPI"), + "caseCountAnalyticsByOpposingNormLawFirmAPI": obj.get("caseCountAnalyticsByOpposingNormLawFirmAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_law_firm_id = norm_law_firm_id - self.norm_law_firm_name = norm_law_firm_name - self.best_match = best_match - self.source_details = source_details - self.confidence_score = confidence_score - self.score_constituents = score_constituents - self.norm_law_firm_api = norm_law_firm_api - self.associated_norm_attorney_api = associated_norm_attorney_api - self.associated_norm_judge_api = associated_norm_judge_api - self.associated_norm_parties_api = associated_norm_parties_api - self.case_count_analytics_by_norm_law_firm_api = case_count_analytics_by_norm_law_firm_api - self.case_count_analytics_by_opposing_norm_law_firm_api = case_count_analytics_by_opposing_norm_law_firm_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/possible_norm_law_firm_score_constituents.py b/unicourt/model/possible_norm_law_firm_score_constituents.py index 9b24cf0..a183c00 100644 --- a/unicourt/model/possible_norm_law_firm_score_constituents.py +++ b/unicourt/model/possible_norm_law_firm_score_constituents.py @@ -1,331 +1,138 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class PossibleNormLawFirmScoreConstituents(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PossibleNormLawFirmScoreConstituents(BaseModel): """ + PossibleNormLawFirmScoreConstituents + """ # noqa: E501 + name_similarity_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="nameSimilarityScore") + other_potential_norm_law_firms: Optional[StrictInt] = Field(default=None, alias="otherPotentialNormLawFirms") + secretary_of_state_id: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="secretaryOfStateId") + address: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + email: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + phone: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["nameSimilarityScore", "otherPotentialNormLawFirms", "secretaryOfStateId", "address", "email", "phone"] + + @field_validator('secretary_of_state_id') + def secretary_of_state_id_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + @field_validator('address') + def address_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + @field_validator('email') + def email_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + @field_validator('phone') + def phone_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('secretary_of_state_id',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - ('address',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - ('email',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - ('phone',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - } - - validations = { - ('secretary_of_state_id',): { - 'max_length': 250, - }, - ('address',): { - 'max_length': 250, - }, - ('email',): { - 'max_length': 250, - }, - ('phone',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PossibleNormLawFirmScoreConstituents from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'name_similarity_score': (float,), # noqa: E501 - 'other_potential_norm_law_firms': (int,), # noqa: E501 - 'secretary_of_state_id': (str,), # noqa: E501 - 'address': (str,), # noqa: E501 - 'email': (str,), # noqa: E501 - 'phone': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'name_similarity_score': 'nameSimilarityScore', # noqa: E501 - 'other_potential_norm_law_firms': 'otherPotentialNormLawFirms', # noqa: E501 - 'secretary_of_state_id': 'secretaryOfStateId', # noqa: E501 - 'address': 'address', # noqa: E501 - 'email': 'email', # noqa: E501 - 'phone': 'phone', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name_similarity_score, other_potential_norm_law_firms, secretary_of_state_id, address, email, phone, *args, **kwargs): # noqa: E501 - """PossibleNormLawFirmScoreConstituents - a model defined in OpenAPI - - Args: - name_similarity_score (float): - other_potential_norm_law_firms (int): - secretary_of_state_id (str): - address (str): - email (str): - phone (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name_similarity_score = name_similarity_score - self.other_potential_norm_law_firms = other_potential_norm_law_firms - self.secretary_of_state_id = secretary_of_state_id - self.address = address - self.email = email - self.phone = phone - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name_similarity_score, other_potential_norm_law_firms, secretary_of_state_id, address, email, phone, *args, **kwargs): # noqa: E501 - """PossibleNormLawFirmScoreConstituents - a model defined in OpenAPI - - Args: - name_similarity_score (float): - other_potential_norm_law_firms (int): - secretary_of_state_id (str): - address (str): - email (str): - phone (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PossibleNormLawFirmScoreConstituents from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "nameSimilarityScore": obj.get("nameSimilarityScore"), + "otherPotentialNormLawFirms": obj.get("otherPotentialNormLawFirms"), + "secretaryOfStateId": obj.get("secretaryOfStateId"), + "address": obj.get("address"), + "email": obj.get("email"), + "phone": obj.get("phone") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.name_similarity_score = name_similarity_score - self.other_potential_norm_law_firms = other_potential_norm_law_firms - self.secretary_of_state_id = secretary_of_state_id - self.address = address - self.email = email - self.phone = phone - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/possible_norm_law_firm_source_details.py b/unicourt/model/possible_norm_law_firm_source_details.py index 858304e..5867a9f 100644 --- a/unicourt/model/possible_norm_law_firm_source_details.py +++ b/unicourt/model/possible_norm_law_firm_source_details.py @@ -1,283 +1,105 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class PossibleNormLawFirmSourceDetails(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PossibleNormLawFirmSourceDetails(BaseModel): """ + PossibleNormLawFirmSourceDetails + """ # noqa: E501 + source: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + linked_norm_attorney_id_array: Optional[List[Annotated[str, Field(min_length=18, strict=True, max_length=18)]]] = Field(default=None, alias="linkedNormAttorneyIdArray") + __properties: ClassVar[List[str]] = ["source", "linkedNormAttorneyIdArray"] + + @field_validator('source') + def source_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Case_Attorney_Linked_In_Other_Cases', 'Case_Attorney_Field_Contains_Law_Firm']): + raise ValueError("must be one of enum values ('Case_Attorney_Linked_In_Other_Cases', 'Case_Attorney_Field_Contains_Law_Firm')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('source',): { - 'None': None, - 'LINKED_IN_OTHER_CASES': "Case_Attorney_Linked_In_Other_Cases", - 'FIELD_CONTAINS_LAW_FIRM': "Case_Attorney_Field_Contains_Law_Firm", - }, - } - - validations = { - ('source',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PossibleNormLawFirmSourceDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'source': (str, none_type,), # noqa: E501 - 'linked_norm_attorney_id_array': ([str],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if source (nullable) is None + # and model_fields_set contains the field + if self.source is None and "source" in self.model_fields_set: + _dict['source'] = None - attribute_map = { - 'source': 'source', # noqa: E501 - 'linked_norm_attorney_id_array': 'linkedNormAttorneyIdArray', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, source, linked_norm_attorney_id_array, *args, **kwargs): # noqa: E501 - """PossibleNormLawFirmSourceDetails - a model defined in OpenAPI - - Args: - source (str, none_type): - linked_norm_attorney_id_array ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.source = source - self.linked_norm_attorney_id_array = linked_norm_attorney_id_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, source, linked_norm_attorney_id_array, *args, **kwargs): # noqa: E501 - """PossibleNormLawFirmSourceDetails - a model defined in OpenAPI - - Args: - source (str, none_type): - linked_norm_attorney_id_array ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PossibleNormLawFirmSourceDetails from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "source": obj.get("source"), + "linkedNormAttorneyIdArray": obj.get("linkedNormAttorneyIdArray") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.source = source - self.linked_norm_attorney_id_array = linked_norm_attorney_id_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/possible_norm_party.py b/unicourt/model/possible_norm_party.py index 2c7c1c0..2d64223 100644 --- a/unicourt/model/possible_norm_party.py +++ b/unicourt/model/possible_norm_party.py @@ -1,374 +1,114 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.possible_norm_party_score_constituents import PossibleNormPartyScoreConstituents - globals()['PossibleNormPartyScoreConstituents'] = PossibleNormPartyScoreConstituents - - -class PossibleNormParty(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 17, - 'min_length': 17, - }, - ('norm_party_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('norm_party_name',): { - 'max_length': 500, - }, - ('norm_party_api',): { - 'max_length': 255, - }, - ('associated_norm_attorneys_api',): { - 'max_length': 255, - }, - ('associated_norm_law_firms_api',): { - 'max_length': 255, - }, - ('associated_norm_judges_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_norm_party_api',): { - 'max_length': 255, - }, - ('case_count_analytics_by_opposing_norm_party_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_party_id': (str,), # noqa: E501 - 'norm_party_name': (str,), # noqa: E501 - 'best_match': (bool,), # noqa: E501 - 'confidence_score': (float,), # noqa: E501 - 'score_constituents': (PossibleNormPartyScoreConstituents,), # noqa: E501 - 'norm_party_api': (str,), # noqa: E501 - 'associated_norm_attorneys_api': (str,), # noqa: E501 - 'associated_norm_law_firms_api': (str,), # noqa: E501 - 'associated_norm_judges_api': (str,), # noqa: E501 - 'case_count_analytics_by_norm_party_api': (str,), # noqa: E501 - 'case_count_analytics_by_opposing_norm_party_api': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_party_id': 'normPartyId', # noqa: E501 - 'norm_party_name': 'normPartyName', # noqa: E501 - 'best_match': 'bestMatch', # noqa: E501 - 'confidence_score': 'confidenceScore', # noqa: E501 - 'score_constituents': 'scoreConstituents', # noqa: E501 - 'norm_party_api': 'normPartyAPI', # noqa: E501 - 'associated_norm_attorneys_api': 'associatedNormAttorneysAPI', # noqa: E501 - 'associated_norm_law_firms_api': 'associatedNormLawFirmsAPI', # noqa: E501 - 'associated_norm_judges_api': 'associatedNormJudgesAPI', # noqa: E501 - 'case_count_analytics_by_norm_party_api': 'caseCountAnalyticsByNormPartyAPI', # noqa: E501 - 'case_count_analytics_by_opposing_norm_party_api': 'caseCountAnalyticsByOpposingNormPartyAPI', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from unicourt.model.possible_norm_party_score_constituents import PossibleNormPartyScoreConstituents +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class PossibleNormParty(BaseModel): + """ + PossibleNormParty + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=17, strict=True, max_length=17)]] = Field(default='PossibleNormParty', description="Name of the object") + norm_party_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normPartyId") + norm_party_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, alias="normPartyName") + best_match: Optional[StrictBool] = Field(default=False, alias="bestMatch") + confidence_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="confidenceScore") + score_constituents: Optional[PossibleNormPartyScoreConstituents] = Field(default=None, alias="scoreConstituents") + norm_party_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to Details For the Party.", alias="normPartyAPI") + associated_norm_attorneys_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormAttorneysAPI") + associated_norm_law_firms_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormLawFirmsAPI") + associated_norm_judges_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="associatedNormJudgesAPI") + case_count_analytics_by_norm_party_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByNormPartyAPI") + case_count_analytics_by_opposing_norm_party_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="caseCountAnalyticsByOpposingNormPartyAPI") + __properties: ClassVar[List[str]] = ["object", "normPartyId", "normPartyName", "bestMatch", "confidenceScore", "scoreConstituents", "normPartyAPI", "associatedNormAttorneysAPI", "associatedNormLawFirmsAPI", "associatedNormJudgesAPI", "caseCountAnalyticsByNormPartyAPI", "caseCountAnalyticsByOpposingNormPartyAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_party_id, norm_party_name, confidence_score, score_constituents, norm_party_api, associated_norm_attorneys_api, associated_norm_law_firms_api, associated_norm_judges_api, case_count_analytics_by_norm_party_api, case_count_analytics_by_opposing_norm_party_api, *args, **kwargs): # noqa: E501 - """PossibleNormParty - a model defined in OpenAPI - - Args: - norm_party_id (str): - norm_party_name (str): - confidence_score (float): - score_constituents (PossibleNormPartyScoreConstituents): - norm_party_api (str): Link to Details For the Party. - associated_norm_attorneys_api (str): - associated_norm_law_firms_api (str): - associated_norm_judges_api (str): - case_count_analytics_by_norm_party_api (str): - case_count_analytics_by_opposing_norm_party_api (str): - - Keyword Args: - object (str): Name of the object. defaults to "PossibleNormParty" # noqa: E501 - best_match (bool): defaults to False # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PossibleNormParty") - best_match = kwargs.get('best_match', False) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PossibleNormParty from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.norm_party_id = norm_party_id - self.norm_party_name = norm_party_name - self.best_match = best_match - self.confidence_score = confidence_score - self.score_constituents = score_constituents - self.norm_party_api = norm_party_api - self.associated_norm_attorneys_api = associated_norm_attorneys_api - self.associated_norm_law_firms_api = associated_norm_law_firms_api - self.associated_norm_judges_api = associated_norm_judges_api - self.case_count_analytics_by_norm_party_api = case_count_analytics_by_norm_party_api - self.case_count_analytics_by_opposing_norm_party_api = case_count_analytics_by_opposing_norm_party_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, norm_party_id, norm_party_name, confidence_score, score_constituents, norm_party_api, associated_norm_attorneys_api, associated_norm_law_firms_api, associated_norm_judges_api, case_count_analytics_by_norm_party_api, case_count_analytics_by_opposing_norm_party_api, *args, **kwargs): # noqa: E501 - """PossibleNormParty - a model defined in OpenAPI - - Args: - norm_party_id (str): - norm_party_name (str): - confidence_score (float): - score_constituents (PossibleNormPartyScoreConstituents): - norm_party_api (str): Link to Details For the Party. - associated_norm_attorneys_api (str): - associated_norm_law_firms_api (str): - associated_norm_judges_api (str): - case_count_analytics_by_norm_party_api (str): - case_count_analytics_by_opposing_norm_party_api (str): - - Keyword Args: - object (str): Name of the object. defaults to "PossibleNormParty" # noqa: E501 - best_match (bool): defaults to False # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of score_constituents + if self.score_constituents: + _dict['scoreConstituents'] = self.score_constituents.to_dict() + return _dict - object = kwargs.get('object', "PossibleNormParty") - best_match = kwargs.get('best_match', False) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PossibleNormParty from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PossibleNormParty', + "normPartyId": obj.get("normPartyId"), + "normPartyName": obj.get("normPartyName"), + "bestMatch": obj.get("bestMatch") if obj.get("bestMatch") is not None else False, + "confidenceScore": obj.get("confidenceScore"), + "scoreConstituents": PossibleNormPartyScoreConstituents.from_dict(obj["scoreConstituents"]) if obj.get("scoreConstituents") is not None else None, + "normPartyAPI": obj.get("normPartyAPI"), + "associatedNormAttorneysAPI": obj.get("associatedNormAttorneysAPI"), + "associatedNormLawFirmsAPI": obj.get("associatedNormLawFirmsAPI"), + "associatedNormJudgesAPI": obj.get("associatedNormJudgesAPI"), + "caseCountAnalyticsByNormPartyAPI": obj.get("caseCountAnalyticsByNormPartyAPI"), + "caseCountAnalyticsByOpposingNormPartyAPI": obj.get("caseCountAnalyticsByOpposingNormPartyAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_party_id = norm_party_id - self.norm_party_name = norm_party_name - self.best_match = best_match - self.confidence_score = confidence_score - self.score_constituents = score_constituents - self.norm_party_api = norm_party_api - self.associated_norm_attorneys_api = associated_norm_attorneys_api - self.associated_norm_law_firms_api = associated_norm_law_firms_api - self.associated_norm_judges_api = associated_norm_judges_api - self.case_count_analytics_by_norm_party_api = case_count_analytics_by_norm_party_api - self.case_count_analytics_by_opposing_norm_party_api = case_count_analytics_by_opposing_norm_party_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/possible_norm_party_score_constituents.py b/unicourt/model/possible_norm_party_score_constituents.py index c810c86..94d9a29 100644 --- a/unicourt/model/possible_norm_party_score_constituents.py +++ b/unicourt/model/possible_norm_party_score_constituents.py @@ -1,331 +1,138 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class PossibleNormPartyScoreConstituents(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PossibleNormPartyScoreConstituents(BaseModel): """ + PossibleNormPartyScoreConstituents + """ # noqa: E501 + name_similarity_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="nameSimilarityScore") + other_potential_norm_parties: Optional[StrictInt] = Field(default=None, alias="otherPotentialNormParties") + secretary_of_state_id: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="secretaryOfStateId") + address: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + email: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + phone: Optional[Annotated[str, Field(strict=True, max_length=250)]] = None + __properties: ClassVar[List[str]] = ["nameSimilarityScore", "otherPotentialNormParties", "secretaryOfStateId", "address", "email", "phone"] + + @field_validator('secretary_of_state_id') + def secretary_of_state_id_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + @field_validator('address') + def address_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + @field_validator('email') + def email_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + @field_validator('phone') + def phone_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Matched', 'Mismatched', 'Not_Provided_By_Data_Source']): + raise ValueError("must be one of enum values ('Matched', 'Mismatched', 'Not_Provided_By_Data_Source')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('secretary_of_state_id',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - ('address',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - ('email',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - ('phone',): { - 'MATCHED': "Matched", - 'MISMATCHED': "Mismatched", - 'NOT_PROVIDED_BY_DATA_SOURCE': "Not_Provided_By_Data_Source", - }, - } - - validations = { - ('secretary_of_state_id',): { - 'max_length': 250, - }, - ('address',): { - 'max_length': 250, - }, - ('email',): { - 'max_length': 250, - }, - ('phone',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PossibleNormPartyScoreConstituents from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'name_similarity_score': (float,), # noqa: E501 - 'other_potential_norm_parties': (int,), # noqa: E501 - 'secretary_of_state_id': (str,), # noqa: E501 - 'address': (str,), # noqa: E501 - 'email': (str,), # noqa: E501 - 'phone': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'name_similarity_score': 'nameSimilarityScore', # noqa: E501 - 'other_potential_norm_parties': 'otherPotentialNormParties', # noqa: E501 - 'secretary_of_state_id': 'secretaryOfStateId', # noqa: E501 - 'address': 'address', # noqa: E501 - 'email': 'email', # noqa: E501 - 'phone': 'phone', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name_similarity_score, other_potential_norm_parties, secretary_of_state_id, address, email, phone, *args, **kwargs): # noqa: E501 - """PossibleNormPartyScoreConstituents - a model defined in OpenAPI - - Args: - name_similarity_score (float): - other_potential_norm_parties (int): - secretary_of_state_id (str): - address (str): - email (str): - phone (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.name_similarity_score = name_similarity_score - self.other_potential_norm_parties = other_potential_norm_parties - self.secretary_of_state_id = secretary_of_state_id - self.address = address - self.email = email - self.phone = phone - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name_similarity_score, other_potential_norm_parties, secretary_of_state_id, address, email, phone, *args, **kwargs): # noqa: E501 - """PossibleNormPartyScoreConstituents - a model defined in OpenAPI - - Args: - name_similarity_score (float): - other_potential_norm_parties (int): - secretary_of_state_id (str): - address (str): - email (str): - phone (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PossibleNormPartyScoreConstituents from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "nameSimilarityScore": obj.get("nameSimilarityScore"), + "otherPotentialNormParties": obj.get("otherPotentialNormParties"), + "secretaryOfStateId": obj.get("secretaryOfStateId"), + "address": obj.get("address"), + "email": obj.get("email"), + "phone": obj.get("phone") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.name_similarity_score = name_similarity_score - self.other_potential_norm_parties = other_potential_norm_parties - self.secretary_of_state_id = secretary_of_state_id - self.address = address - self.email = email - self.phone = phone - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/preview_document.py b/unicourt/model/preview_document.py index 0103794..3cf59f3 100644 --- a/unicourt/model/preview_document.py +++ b/unicourt/model/preview_document.py @@ -1,300 +1,104 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class PreviewDocument(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class PreviewDocument(BaseModel): """ + PreviewDocument + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=15, strict=True, max_length=15)]] = Field(default='PreviewDocument', description="Name of the object") + in_library: Optional[StrictBool] = Field(default=None, description="Determines if the preview document is present in the UniCourt Library or not.", alias="inLibrary") + added_to_library_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="Date and time when the preview document was downloaded and added to the UniCourt CrowdSourced Library.", alias="addedToLibraryDate") + download_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to get the file url for the preview document which is already present in the UniCourt CrowdSourced Library.", alias="downloadAPI") + __properties: ClassVar[List[str]] = ["object", "inLibrary", "addedToLibraryDate", "downloadAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 15, - 'min_length': 15, - }, - ('added_to_library_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('download_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PreviewDocument from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'in_library': (bool,), # noqa: E501 - 'added_to_library_date': (str, none_type,), # noqa: E501 - 'download_api': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'in_library': 'inLibrary', # noqa: E501 - 'added_to_library_date': 'addedToLibraryDate', # noqa: E501 - 'download_api': 'downloadAPI', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if added_to_library_date (nullable) is None + # and model_fields_set contains the field + if self.added_to_library_date is None and "added_to_library_date" in self.model_fields_set: + _dict['addedToLibraryDate'] = None + + # set to None if download_api (nullable) is None + # and model_fields_set contains the field + if self.download_api is None and "download_api" in self.model_fields_set: + _dict['downloadAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, in_library, added_to_library_date, download_api, *args, **kwargs): # noqa: E501 - """PreviewDocument - a model defined in OpenAPI - - Args: - in_library (bool): Determines if the preview document is present in the UniCourt Library or not. - added_to_library_date (str, none_type): Date and time when the preview document was downloaded and added to the UniCourt CrowdSourced Library. - download_api (str, none_type): Link to get the file url for the preview document which is already present in the UniCourt CrowdSourced Library. - - Keyword Args: - object (str): Name of the object. defaults to "PreviewDocument" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "PreviewDocument") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.in_library = in_library - self.added_to_library_date = added_to_library_date - self.download_api = download_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, in_library, added_to_library_date, download_api, *args, **kwargs): # noqa: E501 - """PreviewDocument - a model defined in OpenAPI - - Args: - in_library (bool): Determines if the preview document is present in the UniCourt Library or not. - added_to_library_date (str, none_type): Date and time when the preview document was downloaded and added to the UniCourt CrowdSourced Library. - download_api (str, none_type): Link to get the file url for the preview document which is already present in the UniCourt CrowdSourced Library. - - Keyword Args: - object (str): Name of the object. defaults to "PreviewDocument" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PreviewDocument from a dict""" + if obj is None: + return None - object = kwargs.get('object', "PreviewDocument") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'PreviewDocument', + "inLibrary": obj.get("inLibrary"), + "addedToLibraryDate": obj.get("addedToLibraryDate"), + "downloadAPI": obj.get("downloadAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.in_library = in_library - self.added_to_library_date = added_to_library_date - self.download_api = download_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/raw_ordered_data.py b/unicourt/model/raw_ordered_data.py index dd59a30..ba8a27f 100644 --- a/unicourt/model/raw_ordered_data.py +++ b/unicourt/model/raw_ordered_data.py @@ -1,299 +1,112 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.raw_ordered_data_child import RawOrderedDataChild - globals()['RawOrderedDataChild'] = RawOrderedDataChild +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class RawOrderedData(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.raw_ordered_data_child import RawOrderedDataChild +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class RawOrderedData(BaseModel): """ + RawOrderedData + """ # noqa: E501 + child_array: Optional[List[RawOrderedDataChild]] = Field(default=None, description="Any docket text that belongs to the main docket text is added in the child.", alias="childArray") + lbl: Optional[Annotated[str, Field(strict=True, max_length=100000)]] = Field(default=None, description="Label of the docket from the source.") + ord: Optional[StrictInt] = Field(default=None, description="Structure order") + val: Optional[Annotated[str, Field(strict=True, max_length=1000000)]] = Field(default=None, description="List of available addresses.") + __properties: ClassVar[List[str]] = ["childArray", "lbl", "ord", "val"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('lbl',): { - 'max_length': 100000, - }, - ('val',): { - 'max_length': 1000000, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RawOrderedData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'child_array': ([RawOrderedDataChild],), # noqa: E501 - 'lbl': (str, none_type,), # noqa: E501 - 'ord': (int,), # noqa: E501 - 'val': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'child_array': 'childArray', # noqa: E501 - 'lbl': 'lbl', # noqa: E501 - 'ord': 'ord', # noqa: E501 - 'val': 'val', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in child_array (list) + _items = [] + if self.child_array: + for _item in self.child_array: + if _item: + _items.append(_item.to_dict()) + _dict['childArray'] = _items + # set to None if lbl (nullable) is None + # and model_fields_set contains the field + if self.lbl is None and "lbl" in self.model_fields_set: + _dict['lbl'] = None + + # set to None if val (nullable) is None + # and model_fields_set contains the field + if self.val is None and "val" in self.model_fields_set: + _dict['val'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, child_array, lbl, ord, val, *args, **kwargs): # noqa: E501 - """RawOrderedData - a model defined in OpenAPI - - Args: - child_array ([RawOrderedDataChild]): Any docket text that belongs to the main docket text is added in the child. - lbl (str, none_type): Label of the docket from the source. - ord (int): Structure order - val (str, none_type): List of available addresses. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.child_array = child_array - self.lbl = lbl - self.ord = ord - self.val = val - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, child_array, lbl, ord, val, *args, **kwargs): # noqa: E501 - """RawOrderedData - a model defined in OpenAPI - - Args: - child_array ([RawOrderedDataChild]): Any docket text that belongs to the main docket text is added in the child. - lbl (str, none_type): Label of the docket from the source. - ord (int): Structure order - val (str, none_type): List of available addresses. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RawOrderedData from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "childArray": [RawOrderedDataChild.from_dict(_item) for _item in obj["childArray"]] if obj.get("childArray") is not None else None, + "lbl": obj.get("lbl"), + "ord": obj.get("ord"), + "val": obj.get("val") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.child_array = child_array - self.lbl = lbl - self.ord = ord - self.val = val - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/raw_ordered_data_child.py b/unicourt/model/raw_ordered_data_child.py index 699692f..7db57a8 100644 --- a/unicourt/model/raw_ordered_data_child.py +++ b/unicourt/model/raw_ordered_data_child.py @@ -1,299 +1,112 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.raw_ordered_data_child_child_array_inner import RawOrderedDataChildChildArrayInner - globals()['RawOrderedDataChildChildArrayInner'] = RawOrderedDataChildChildArrayInner +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class RawOrderedDataChild(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.raw_ordered_data_child_child_array_inner import RawOrderedDataChildChildArrayInner +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class RawOrderedDataChild(BaseModel): """ + RawOrderedDataChild + """ # noqa: E501 + child_array: Optional[List[RawOrderedDataChildChildArrayInner]] = Field(default=None, description="Any docket text that belongs to the main docket text is added in the child.", alias="childArray") + lbl: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Label of the docket from the source.") + ord: Optional[StrictInt] = Field(default=None, description="Structure order.") + val: Optional[Annotated[str, Field(strict=True, max_length=100000)]] = Field(default=None, description="List of available addresses.") + __properties: ClassVar[List[str]] = ["childArray", "lbl", "ord", "val"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('lbl',): { - 'max_length': 255, - }, - ('val',): { - 'max_length': 100000, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RawOrderedDataChild from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'child_array': ([RawOrderedDataChildChildArrayInner],), # noqa: E501 - 'lbl': (str, none_type,), # noqa: E501 - 'ord': (int,), # noqa: E501 - 'val': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'child_array': 'childArray', # noqa: E501 - 'lbl': 'lbl', # noqa: E501 - 'ord': 'ord', # noqa: E501 - 'val': 'val', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in child_array (list) + _items = [] + if self.child_array: + for _item in self.child_array: + if _item: + _items.append(_item.to_dict()) + _dict['childArray'] = _items + # set to None if lbl (nullable) is None + # and model_fields_set contains the field + if self.lbl is None and "lbl" in self.model_fields_set: + _dict['lbl'] = None + + # set to None if val (nullable) is None + # and model_fields_set contains the field + if self.val is None and "val" in self.model_fields_set: + _dict['val'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, child_array, lbl, ord, val, *args, **kwargs): # noqa: E501 - """RawOrderedDataChild - a model defined in OpenAPI - - Args: - child_array ([RawOrderedDataChildChildArrayInner]): Any docket text that belongs to the main docket text is added in the child. - lbl (str, none_type): Label of the docket from the source. - ord (int): Structure order. - val (str, none_type): List of available addresses. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.child_array = child_array - self.lbl = lbl - self.ord = ord - self.val = val - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, child_array, lbl, ord, val, *args, **kwargs): # noqa: E501 - """RawOrderedDataChild - a model defined in OpenAPI - - Args: - child_array ([RawOrderedDataChildChildArrayInner]): Any docket text that belongs to the main docket text is added in the child. - lbl (str, none_type): Label of the docket from the source. - ord (int): Structure order. - val (str, none_type): List of available addresses. - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RawOrderedDataChild from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "childArray": [RawOrderedDataChildChildArrayInner.from_dict(_item) for _item in obj["childArray"]] if obj.get("childArray") is not None else None, + "lbl": obj.get("lbl"), + "ord": obj.get("ord"), + "val": obj.get("val") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.child_array = child_array - self.lbl = lbl - self.ord = ord - self.val = val - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/raw_ordered_data_child_child_array_inner.py b/unicourt/model/raw_ordered_data_child_child_array_inner.py index d57fa33..1e1473b 100644 --- a/unicourt/model/raw_ordered_data_child_child_array_inner.py +++ b/unicourt/model/raw_ordered_data_child_child_array_inner.py @@ -1,293 +1,104 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class RawOrderedDataChildChildArrayInner(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class RawOrderedDataChildChildArrayInner(BaseModel): """ + Contact object Data Schema. + """ # noqa: E501 + lbl: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="Label of the docket from the source.") + ord: Optional[StrictInt] = Field(default=None, description="Structure order.") + val: Optional[Annotated[str, Field(strict=True, max_length=1000000)]] = Field(default=None, description="List of available addresses.") + child_array: Optional[List[Dict[str, Any]]] = Field(default=None, alias="childArray") + __properties: ClassVar[List[str]] = ["lbl", "ord", "val", "childArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('lbl',): { - 'max_length': 500, - }, - ('val',): { - 'max_length': 1000000, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RawOrderedDataChildChildArrayInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'lbl': (str, none_type,), # noqa: E501 - 'ord': (int,), # noqa: E501 - 'val': (str, none_type,), # noqa: E501 - 'child_array': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'lbl': 'lbl', # noqa: E501 - 'ord': 'ord', # noqa: E501 - 'val': 'val', # noqa: E501 - 'child_array': 'childArray', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if lbl (nullable) is None + # and model_fields_set contains the field + if self.lbl is None and "lbl" in self.model_fields_set: + _dict['lbl'] = None + + # set to None if val (nullable) is None + # and model_fields_set contains the field + if self.val is None and "val" in self.model_fields_set: + _dict['val'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, lbl, ord, val, child_array, *args, **kwargs): # noqa: E501 - """RawOrderedDataChildChildArrayInner - a model defined in OpenAPI - - Args: - lbl (str, none_type): Label of the docket from the source. - ord (int): Structure order. - val (str, none_type): List of available addresses. - child_array ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.lbl = lbl - self.ord = ord - self.val = val - self.child_array = child_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, lbl, ord, val, child_array, *args, **kwargs): # noqa: E501 - """RawOrderedDataChildChildArrayInner - a model defined in OpenAPI - - Args: - lbl (str, none_type): Label of the docket from the source. - ord (int): Structure order. - val (str, none_type): List of available addresses. - child_array ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RawOrderedDataChildChildArrayInner from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "lbl": obj.get("lbl"), + "ord": obj.get("ord"), + "val": obj.get("val"), + "childArray": obj.get("childArray") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.lbl = lbl - self.ord = ord - self.val = val - self.child_array = child_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/referenced_docket_number.py b/unicourt/model/referenced_docket_number.py index 75491ad..bd869d8 100644 --- a/unicourt/model/referenced_docket_number.py +++ b/unicourt/model/referenced_docket_number.py @@ -1,290 +1,97 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class ReferencedDocketNumber(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 22, - 'min_length': 22, - }, - ('docket_entries_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'docket_number': (int,), # noqa: E501 - 'docket_entries_api': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class ReferencedDocketNumber(BaseModel): + """ + Object consisiting of each docket entry number and its corresponding API call. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=22, strict=True, max_length=22)]] = Field(default='ReferencedDocketNumber', description="Name of the object") + docket_number: Optional[StrictInt] = Field(default=None, description="Each referenced docket number", alias="docketNumber") + docket_entries_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to Docket Entries API with the current docket number. The response of this API will give all the primary documents and secondary documents that are associated to it.", alias="docketEntriesAPI") + __properties: ClassVar[List[str]] = ["object", "docketNumber", "docketEntriesAPI"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'object': 'object', # noqa: E501 - 'docket_number': 'docketNumber', # noqa: E501 - 'docket_entries_api': 'docketEntriesAPI', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, docket_number, docket_entries_api, *args, **kwargs): # noqa: E501 - """ReferencedDocketNumber - a model defined in OpenAPI - - Args: - docket_number (int): Each referenced docket number - docket_entries_api (str, none_type): Link to Docket Entries API with the current docket number. The response of this API will give all the primary documents and secondary documents that are associated to it. - - Keyword Args: - object (str): Name of the object. defaults to "ReferencedDocketNumber" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "ReferencedDocketNumber") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ReferencedDocketNumber from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self.object = object - self.docket_number = docket_number - self.docket_entries_api = docket_entries_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - @convert_js_args_to_python_args - def __init__(self, docket_number, docket_entries_api, *args, **kwargs): # noqa: E501 - """ReferencedDocketNumber - a model defined in OpenAPI + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if docket_entries_api (nullable) is None + # and model_fields_set contains the field + if self.docket_entries_api is None and "docket_entries_api" in self.model_fields_set: + _dict['docketEntriesAPI'] = None - Args: - docket_number (int): Each referenced docket number - docket_entries_api (str, none_type): Link to Docket Entries API with the current docket number. The response of this API will give all the primary documents and secondary documents that are associated to it. + return _dict - Keyword Args: - object (str): Name of the object. defaults to "ReferencedDocketNumber" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReferencedDocketNumber from a dict""" + if obj is None: + return None - object = kwargs.get('object', "ReferencedDocketNumber") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'ReferencedDocketNumber', + "docketNumber": obj.get("docketNumber"), + "docketEntriesAPI": obj.get("docketEntriesAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.docket_number = docket_number - self.docket_entries_api = docket_entries_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/related_case.py b/unicourt/model/related_case.py index f131c12..7004c1c 100644 --- a/unicourt/model/related_case.py +++ b/unicourt/model/related_case.py @@ -1,349 +1,127 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.case_relationship_type import CaseRelationshipType - from unicourt.model.source_structured_data import SourceStructuredData - globals()['CaseRelationshipType'] = CaseRelationshipType - globals()['SourceStructuredData'] = SourceStructuredData - - -class RelatedCase(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 11, - 'min_length': 11, - }, - ('case_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('case_number',): { - 'max_length': 50, - 'min_length': 3, - }, - ('case_name',): { - 'max_length': 250, - }, - ('source_case_relationship_type',): { - 'max_length': 250, - 'min_length': 3, - }, - ('case_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'case_id': (str, none_type,), # noqa: E501 - 'case_number': (str,), # noqa: E501 - 'case_name': (str, none_type,), # noqa: E501 - 'case_relationship_type': (CaseRelationshipType,), # noqa: E501 - 'source_case_relationship_type': (str,), # noqa: E501 - 'is_visible': (bool,), # noqa: E501 - 'additional_source_data': (SourceStructuredData,), # noqa: E501 - 'case_api': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'case_id': 'caseId', # noqa: E501 - 'case_number': 'caseNumber', # noqa: E501 - 'case_name': 'caseName', # noqa: E501 - 'case_relationship_type': 'caseRelationshipType', # noqa: E501 - 'source_case_relationship_type': 'sourceCaseRelationshipType', # noqa: E501 - 'is_visible': 'isVisible', # noqa: E501 - 'additional_source_data': 'additionalSourceData', # noqa: E501 - 'case_api': 'caseAPI', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.case_relationship_type import CaseRelationshipType +from unicourt.model.source_structured_data import SourceStructuredData +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class RelatedCase(BaseModel): + """ + RelatedCase + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=11, strict=True, max_length=11)]] = Field(default='RelatedCase', description="Name of the object") + case_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, description="Case ID of the related Case. This can be null if this case in not found in our database. However the meta information of the related case will be present.", alias="caseId") + case_number: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]] = Field(default=None, description="Case Number of the related Case.", alias="caseNumber") + case_name: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="Case Name of the related Case.", alias="caseName") + case_relationship_type: Optional[CaseRelationshipType] = Field(default=None, alias="caseRelationshipType") + source_case_relationship_type: Optional[Annotated[str, Field(min_length=3, strict=True, max_length=250)]] = Field(default=None, description="Case Relationship Type provided by court.", alias="sourceCaseRelationshipType") + is_visible: Optional[StrictBool] = Field(default=None, description="This specifies if the related cases is still related to the parent case or not.", alias="isVisible") + additional_source_data: Optional[SourceStructuredData] = Field(default=None, alias="additionalSourceData") + case_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to the Case API of the current related case.", alias="caseAPI") + __properties: ClassVar[List[str]] = ["object", "caseId", "caseNumber", "caseName", "caseRelationshipType", "sourceCaseRelationshipType", "isVisible", "additionalSourceData", "caseAPI"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, case_id, case_number, case_name, case_relationship_type, source_case_relationship_type, is_visible, additional_source_data, case_api, *args, **kwargs): # noqa: E501 - """RelatedCase - a model defined in OpenAPI - - Args: - case_id (str, none_type): Case ID of the related Case. This can be null if this case in not found in our database. However the meta information of the related case will be present. - case_number (str): Case Number of the related Case. - case_name (str, none_type): Case Name of the related Case. - case_relationship_type (CaseRelationshipType): - source_case_relationship_type (str): Case Relationship Type provided by court. - is_visible (bool): This specifies if the related cases is still related to the parent case or not. - additional_source_data (SourceStructuredData): - case_api (str, none_type): Link to the Case API of the current related case. - - Keyword Args: - object (str): Name of the object. defaults to "RelatedCase" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "RelatedCase") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RelatedCase from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.case_id = case_id - self.case_number = case_number - self.case_name = case_name - self.case_relationship_type = case_relationship_type - self.source_case_relationship_type = source_case_relationship_type - self.is_visible = is_visible - self.additional_source_data = additional_source_data - self.case_api = case_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, case_id, case_number, case_name, case_relationship_type, source_case_relationship_type, is_visible, additional_source_data, case_api, *args, **kwargs): # noqa: E501 - """RelatedCase - a model defined in OpenAPI - - Args: - case_id (str, none_type): Case ID of the related Case. This can be null if this case in not found in our database. However the meta information of the related case will be present. - case_number (str): Case Number of the related Case. - case_name (str, none_type): Case Name of the related Case. - case_relationship_type (CaseRelationshipType): - source_case_relationship_type (str): Case Relationship Type provided by court. - is_visible (bool): This specifies if the related cases is still related to the parent case or not. - additional_source_data (SourceStructuredData): - case_api (str, none_type): Link to the Case API of the current related case. - - Keyword Args: - object (str): Name of the object. defaults to "RelatedCase" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of case_relationship_type + if self.case_relationship_type: + _dict['caseRelationshipType'] = self.case_relationship_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of additional_source_data + if self.additional_source_data: + _dict['additionalSourceData'] = self.additional_source_data.to_dict() + # set to None if case_id (nullable) is None + # and model_fields_set contains the field + if self.case_id is None and "case_id" in self.model_fields_set: + _dict['caseId'] = None + + # set to None if case_name (nullable) is None + # and model_fields_set contains the field + if self.case_name is None and "case_name" in self.model_fields_set: + _dict['caseName'] = None + + # set to None if case_api (nullable) is None + # and model_fields_set contains the field + if self.case_api is None and "case_api" in self.model_fields_set: + _dict['caseAPI'] = None + + return _dict - object = kwargs.get('object', "RelatedCase") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RelatedCase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'RelatedCase', + "caseId": obj.get("caseId"), + "caseNumber": obj.get("caseNumber"), + "caseName": obj.get("caseName"), + "caseRelationshipType": CaseRelationshipType.from_dict(obj["caseRelationshipType"]) if obj.get("caseRelationshipType") is not None else None, + "sourceCaseRelationshipType": obj.get("sourceCaseRelationshipType"), + "isVisible": obj.get("isVisible"), + "additionalSourceData": SourceStructuredData.from_dict(obj["additionalSourceData"]) if obj.get("additionalSourceData") is not None else None, + "caseAPI": obj.get("caseAPI") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.case_id = case_id - self.case_number = case_number - self.case_name = case_name - self.case_relationship_type = case_relationship_type - self.source_case_relationship_type = source_case_relationship_type - self.is_visible = is_visible - self.additional_source_data = additional_source_data - self.case_api = case_api - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/related_cases.py b/unicourt/model/related_cases.py index a398f40..e4b0ac8 100644 --- a/unicourt/model/related_cases.py +++ b/unicourt/model/related_cases.py @@ -1,317 +1,111 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.related_case import RelatedCase - globals()['RelatedCase'] = RelatedCase +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class RelatedCases(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.related_case import RelatedCase +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class RelatedCases(BaseModel): """ + RelatedCases + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=12, strict=True, max_length=12)]] = Field(default='RelatedCases', description="Name of the object") + page_number: Optional[StrictInt] = Field(default=None, description="Page number for which results where obtained.", alias="pageNumber") + related_case_array: Optional[Annotated[List[RelatedCase], Field(max_length=100)]] = Field(default=None, alias="relatedCaseArray") + next_page_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Link to next page of a particular entity in a Case.", alias="nextPageAPI") + total_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages to obtain all the objects of a party in the Case.", alias="totalPages") + total_count: Optional[StrictInt] = Field(default=None, description="Total number of parties of the Case entity in a Case.", alias="totalCount") + __properties: ClassVar[List[str]] = ["object", "pageNumber", "relatedCaseArray", "nextPageAPI", "totalPages", "totalCount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 12, - 'min_length': 12, - }, - ('related_case_array',): { - 'max_items': 100, - }, - ('next_page_api',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RelatedCases from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'page_number': (int,), # noqa: E501 - 'related_case_array': ([RelatedCase],), # noqa: E501 - 'next_page_api': (str, none_type,), # noqa: E501 - 'total_pages': (int,), # noqa: E501 - 'total_count': (int,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'page_number': 'pageNumber', # noqa: E501 - 'related_case_array': 'relatedCaseArray', # noqa: E501 - 'next_page_api': 'nextPageAPI', # noqa: E501 - 'total_pages': 'totalPages', # noqa: E501 - 'total_count': 'totalCount', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in related_case_array (list) + _items = [] + if self.related_case_array: + for _item in self.related_case_array: + if _item: + _items.append(_item.to_dict()) + _dict['relatedCaseArray'] = _items + # set to None if next_page_api (nullable) is None + # and model_fields_set contains the field + if self.next_page_api is None and "next_page_api" in self.model_fields_set: + _dict['nextPageAPI'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, page_number, related_case_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """RelatedCases - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - related_case_array ([RelatedCase]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "RelatedCases" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "RelatedCases") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.page_number = page_number - self.related_case_array = related_case_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, page_number, related_case_array, next_page_api, total_pages, total_count, *args, **kwargs): # noqa: E501 - """RelatedCases - a model defined in OpenAPI - - Args: - page_number (int): Page number for which results where obtained. - related_case_array ([RelatedCase]): - next_page_api (str, none_type): Link to next page of a particular entity in a Case. - total_pages (int): Total number of pages to obtain all the objects of a party in the Case. - total_count (int): Total number of parties of the Case entity in a Case. - - Keyword Args: - object (str): Name of the object. defaults to "RelatedCases" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RelatedCases from a dict""" + if obj is None: + return None - object = kwargs.get('object', "RelatedCases") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'RelatedCases', + "pageNumber": obj.get("pageNumber"), + "relatedCaseArray": [RelatedCase.from_dict(_item) for _item in obj["relatedCaseArray"]] if obj.get("relatedCaseArray") is not None else None, + "nextPageAPI": obj.get("nextPageAPI"), + "totalPages": obj.get("totalPages"), + "totalCount": obj.get("totalCount") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.page_number = page_number - self.related_case_array = related_case_array - self.next_page_api = next_page_api - self.total_pages = total_pages - self.total_count = total_count - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/related_norm_party.py b/unicourt/model/related_norm_party.py index 920585b..039f89a 100644 --- a/unicourt/model/related_norm_party.py +++ b/unicourt/model/related_norm_party.py @@ -1,298 +1,102 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class RelatedNormParty(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class RelatedNormParty(BaseModel): """ + RelatedNormParty + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=16)]] = 'RelatedNormParty' + norm_party_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normPartyId") + relationship_type: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="relationshipType") + __properties: ClassVar[List[str]] = ["object", "normPartyId", "relationshipType"] + + @field_validator('relationship_type') + def relationship_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Parent', 'Child', 'Same_Corporate_Group']): + raise ValueError("must be one of enum values ('Parent', 'Child', 'Same_Corporate_Group')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('relationship_type',): { - 'PARENT': "Parent", - 'CHILD': "Child", - 'SAME_CORPORATE_GROUP': "Same_Corporate_Group", - }, - } - - validations = { - ('object',): { - 'max_length': 16, - }, - ('norm_party_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('relationship_type',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RelatedNormParty from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'norm_party_id': (str,), # noqa: E501 - 'relationship_type': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_party_id': 'normPartyId', # noqa: E501 - 'relationship_type': 'relationshipType', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_party_id, relationship_type, *args, **kwargs): # noqa: E501 - """RelatedNormParty - a model defined in OpenAPI - - Args: - norm_party_id (str): - relationship_type (str): - - Keyword Args: - object (str): defaults to "RelatedNormParty" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "RelatedNormParty") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_party_id = norm_party_id - self.relationship_type = relationship_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_party_id, relationship_type, *args, **kwargs): # noqa: E501 - """RelatedNormParty - a model defined in OpenAPI - - Args: - norm_party_id (str): - relationship_type (str): - - Keyword Args: - object (str): defaults to "RelatedNormParty" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RelatedNormParty from a dict""" + if obj is None: + return None - object = kwargs.get('object', "RelatedNormParty") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'RelatedNormParty', + "normPartyId": obj.get("normPartyId"), + "relationshipType": obj.get("relationshipType") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_party_id = norm_party_id - self.relationship_type = relationship_type - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/schedule.py b/unicourt/model/schedule.py index 1d41a40..16e956d 100644 --- a/unicourt/model/schedule.py +++ b/unicourt/model/schedule.py @@ -1,296 +1,102 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class Schedule(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class Schedule(BaseModel): """ + Schedule + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=8, strict=True, max_length=8)]] = Field(default='Schedule', description="Name of the object.") + type: Optional[Annotated[str, Field(min_length=5, strict=True, max_length=7)]] = None + days: Optional[List[StrictInt]] = Field(default=None, description="[] -> if schedule type is daily
1-7 -> if schedule type is weekly
1-31 -> if schedule type is monthly ") + __properties: ClassVar[List[str]] = ["object", "type", "days"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['daily', 'weekly', 'monthly']): + raise ValueError("must be one of enum values ('daily', 'weekly', 'monthly')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('type',): { - 'DAILY': "daily", - 'WEEKLY': "weekly", - 'MONTHLY': "monthly", - }, - } - - validations = { - ('object',): { - 'max_length': 8, - 'min_length': 8, - }, - ('type',): { - 'max_length': 7, - 'min_length': 5, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Schedule from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'days': ([int],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None + excluded_fields: Set[str] = set([ + ]) - - attribute_map = { - 'object': 'object', # noqa: E501 - 'type': 'type', # noqa: E501 - 'days': 'days', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, days, *args, **kwargs): # noqa: E501 - """Schedule - a model defined in OpenAPI - - Args: - type (str): - days ([int]): [] -> if schedule type is daily
1-7 -> if schedule type is weekly
1-31 -> if schedule type is monthly - - Keyword Args: - object (str): Name of the object.. defaults to "Schedule" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "Schedule") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.type = type - self.days = days - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, type, days, *args, **kwargs): # noqa: E501 - """Schedule - a model defined in OpenAPI - - Args: - type (str): - days ([int]): [] -> if schedule type is daily
1-7 -> if schedule type is weekly
1-31 -> if schedule type is monthly - - Keyword Args: - object (str): Name of the object.. defaults to "Schedule" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Schedule from a dict""" + if obj is None: + return None - object = kwargs.get('object', "Schedule") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Schedule', + "type": obj.get("type"), + "days": obj.get("days") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.type = type - self.days = days - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/service_history.py b/unicourt/model/service_history.py index 266c947..67cf3e2 100644 --- a/unicourt/model/service_history.py +++ b/unicourt/model/service_history.py @@ -1,346 +1,147 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class ServiceHistory(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 14, - }, - ('appointed_by',): { - 'max_length': 100, - }, - ('reason_for_termination',): { - 'max_length': 50, - }, - ('source_court',): { - 'max_length': 250, - }, - ('title',): { - 'max_length': 50, - }, - ('from_date',): { - 'max_length': 25, - }, - ('to_date',): { - 'max_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'appointed_by': (str, none_type,), # noqa: E501 - 'reason_for_termination': (str, none_type,), # noqa: E501 - 'source_court': (str, none_type,), # noqa: E501 - 'title': (str, none_type,), # noqa: E501 - 'from_year': (int, none_type,), # noqa: E501 - 'to_year': (int, none_type,), # noqa: E501 - 'from_date': (datetime, none_type,), # noqa: E501 - 'to_date': (datetime, none_type,), # noqa: E501 - 'is_visible': (bool,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'appointed_by': 'appointedBy', # noqa: E501 - 'reason_for_termination': 'reasonForTermination', # noqa: E501 - 'source_court': 'sourceCourt', # noqa: E501 - 'title': 'title', # noqa: E501 - 'from_year': 'fromYear', # noqa: E501 - 'to_year': 'toYear', # noqa: E501 - 'from_date': 'fromDate', # noqa: E501 - 'to_date': 'toDate', # noqa: E501 - 'is_visible': 'isVisible', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class ServiceHistory(BaseModel): + """ + A timeline of courts where the judge has been employed. + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=14)]] = 'ServiceHistory' + appointed_by: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="The President-in-charge of the Judges appointment.", alias="appointedBy") + reason_for_termination: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="The reason for the Judges termination for the current position.", alias="reasonForTermination") + source_court: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="The court served by the Judge. The court is taken from source.", alias="sourceCourt") + title: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="Title held by the Judge.") + from_year: Optional[StrictInt] = Field(default=None, description="The year in which the Judge began practicing in his current service.", alias="fromYear") + to_year: Optional[StrictInt] = Field(default=None, description="The year in which the Judge stoped practicing in his current service.", alias="toYear") + from_date: Optional[datetime] = Field(default=None, description="The year in which the Judge began practicing in his current service.", alias="fromDate") + to_date: Optional[datetime] = Field(default=None, description="The year in which the Judge stoped practicing in his current service.", alias="toDate") + is_visible: Optional[StrictBool] = Field(default=None, description="Boolean indicating if the service history is visible or not.", alias="isVisible") + __properties: ClassVar[List[str]] = ["object", "appointedBy", "reasonForTermination", "sourceCourt", "title", "fromYear", "toYear", "fromDate", "toDate", "isVisible"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, appointed_by, reason_for_termination, source_court, title, from_year, to_year, from_date, to_date, is_visible, *args, **kwargs): # noqa: E501 - """ServiceHistory - a model defined in OpenAPI - - Args: - appointed_by (str, none_type): The President-in-charge of the Judges appointment. - reason_for_termination (str, none_type): The reason for the Judges termination for the current position. - source_court (str, none_type): The court served by the Judge. The court is taken from source. - title (str, none_type): Title held by the Judge. - from_year (int, none_type): The year in which the Judge began practicing in his current service. - to_year (int, none_type): The year in which the Judge stoped practicing in his current service. - from_date (datetime, none_type): The year in which the Judge began practicing in his current service. - to_date (datetime, none_type): The year in which the Judge stoped practicing in his current service. - is_visible (bool): Boolean indicating if the service history is visible or not. - - Keyword Args: - object (str): defaults to "ServiceHistory" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ServiceHistory from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "ServiceHistory") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.appointed_by = appointed_by - self.reason_for_termination = reason_for_termination - self.source_court = source_court - self.title = title - self.from_year = from_year - self.to_year = to_year - self.from_date = from_date - self.to_date = to_date - self.is_visible = is_visible - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, appointed_by, reason_for_termination, source_court, title, from_year, to_year, from_date, to_date, is_visible, *args, **kwargs): # noqa: E501 - """ServiceHistory - a model defined in OpenAPI - - Args: - appointed_by (str, none_type): The President-in-charge of the Judges appointment. - reason_for_termination (str, none_type): The reason for the Judges termination for the current position. - source_court (str, none_type): The court served by the Judge. The court is taken from source. - title (str, none_type): Title held by the Judge. - from_year (int, none_type): The year in which the Judge began practicing in his current service. - to_year (int, none_type): The year in which the Judge stoped practicing in his current service. - from_date (datetime, none_type): The year in which the Judge began practicing in his current service. - to_date (datetime, none_type): The year in which the Judge stoped practicing in his current service. - is_visible (bool): Boolean indicating if the service history is visible or not. - - Keyword Args: - object (str): defaults to "ServiceHistory" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if appointed_by (nullable) is None + # and model_fields_set contains the field + if self.appointed_by is None and "appointed_by" in self.model_fields_set: + _dict['appointedBy'] = None + + # set to None if reason_for_termination (nullable) is None + # and model_fields_set contains the field + if self.reason_for_termination is None and "reason_for_termination" in self.model_fields_set: + _dict['reasonForTermination'] = None + + # set to None if source_court (nullable) is None + # and model_fields_set contains the field + if self.source_court is None and "source_court" in self.model_fields_set: + _dict['sourceCourt'] = None + + # set to None if title (nullable) is None + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: + _dict['title'] = None + + # set to None if from_year (nullable) is None + # and model_fields_set contains the field + if self.from_year is None and "from_year" in self.model_fields_set: + _dict['fromYear'] = None + + # set to None if to_year (nullable) is None + # and model_fields_set contains the field + if self.to_year is None and "to_year" in self.model_fields_set: + _dict['toYear'] = None + + # set to None if from_date (nullable) is None + # and model_fields_set contains the field + if self.from_date is None and "from_date" in self.model_fields_set: + _dict['fromDate'] = None + + # set to None if to_date (nullable) is None + # and model_fields_set contains the field + if self.to_date is None and "to_date" in self.model_fields_set: + _dict['toDate'] = None + + return _dict - object = kwargs.get('object', "ServiceHistory") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ServiceHistory from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'ServiceHistory', + "appointedBy": obj.get("appointedBy"), + "reasonForTermination": obj.get("reasonForTermination"), + "sourceCourt": obj.get("sourceCourt"), + "title": obj.get("title"), + "fromYear": obj.get("fromYear"), + "toYear": obj.get("toYear"), + "fromDate": obj.get("fromDate"), + "toDate": obj.get("toDate"), + "isVisible": obj.get("isVisible") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.appointed_by = appointed_by - self.reason_for_termination = reason_for_termination - self.source_court = source_court - self.title = title - self.from_year = from_year - self.to_year = to_year - self.from_date = from_date - self.to_date = to_date - self.is_visible = is_visible - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/service_status.py b/unicourt/model/service_status.py index 133dc56..7cc737a 100644 --- a/unicourt/model/service_status.py +++ b/unicourt/model/service_status.py @@ -1,310 +1,108 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.service_status_down_details import ServiceStatusDownDetails - globals()['ServiceStatusDownDetails'] = ServiceStatusDownDetails +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class ServiceStatus(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.service_status_down_details import ServiceStatusDownDetails +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class ServiceStatus(BaseModel): """ + ServiceStatus + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=13, strict=True, max_length=13)]] = Field(default='ServiceStatus', description="Name of the object") + service_up: Optional[StrictBool] = Field(default=None, description="Status of Case Update Services Status.", alias="serviceUp") + service_details: Optional[StrictStr] = Field(default=None, description="Status Details of Case Update Services Status.", alias="serviceDetails") + service_status_down_details: Optional[ServiceStatusDownDetails] = Field(default=None, alias="serviceStatusDownDetails") + __properties: ClassVar[List[str]] = ["object", "serviceUp", "serviceDetails", "serviceStatusDownDetails"] + + @field_validator('service_details') + def service_details_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['acceptingCaseUpdates', 'notAcceptingCaseUpdates', 'acceptingCaseTrack', 'notAcceptingCaseTrack', 'acceptingAutoDocOrders', 'acceptingManualDocOrders', 'notAcceptingAutoDocOrdersLimitExceeded', 'notAcceptingManualDocOrdersLimitExceeded', 'notAcceptingDocOrders']): + raise ValueError("must be one of enum values ('acceptingCaseUpdates', 'notAcceptingCaseUpdates', 'acceptingCaseTrack', 'notAcceptingCaseTrack', 'acceptingAutoDocOrders', 'acceptingManualDocOrders', 'notAcceptingAutoDocOrdersLimitExceeded', 'notAcceptingManualDocOrdersLimitExceeded', 'notAcceptingDocOrders')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('service_details',): { - 'ACCEPTINGCASEUPDATES': "acceptingCaseUpdates", - 'NOTACCEPTINGCASEUPDATES': "notAcceptingCaseUpdates", - 'ACCEPTINGCASETRACK': "acceptingCaseTrack", - 'NOTACCEPTINGCASETRACK': "notAcceptingCaseTrack", - 'ACCEPTINGAUTODOCORDERS': "acceptingAutoDocOrders", - 'ACCEPTINGMANUALDOCORDERS': "acceptingManualDocOrders", - 'NOTACCEPTINGAUTODOCORDERSLIMITEXCEEDED': "notAcceptingAutoDocOrdersLimitExceeded", - 'NOTACCEPTINGMANUALDOCORDERSLIMITEXCEEDED': "notAcceptingManualDocOrdersLimitExceeded", - 'NOTACCEPTINGDOCORDERS': "notAcceptingDocOrders", - }, - } - - validations = { - ('object',): { - 'max_length': 13, - 'min_length': 13, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ServiceStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'service_up': (bool,), # noqa: E501 - 'service_details': (str,), # noqa: E501 - 'service_status_down_details': (ServiceStatusDownDetails,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'service_up': 'serviceUp', # noqa: E501 - 'service_details': 'serviceDetails', # noqa: E501 - 'service_status_down_details': 'serviceStatusDownDetails', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of service_status_down_details + if self.service_status_down_details: + _dict['serviceStatusDownDetails'] = self.service_status_down_details.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, service_up, service_details, service_status_down_details, *args, **kwargs): # noqa: E501 - """ServiceStatus - a model defined in OpenAPI - - Args: - service_up (bool): Status of Case Update Services Status. - service_details (str): Status Details of Case Update Services Status. - service_status_down_details (ServiceStatusDownDetails): - - Keyword Args: - object (str): Name of the object. defaults to "ServiceStatus" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "ServiceStatus") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.service_up = service_up - self.service_details = service_details - self.service_status_down_details = service_status_down_details - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, service_up, service_details, service_status_down_details, *args, **kwargs): # noqa: E501 - """ServiceStatus - a model defined in OpenAPI - - Args: - service_up (bool): Status of Case Update Services Status. - service_details (str): Status Details of Case Update Services Status. - service_status_down_details (ServiceStatusDownDetails): - - Keyword Args: - object (str): Name of the object. defaults to "ServiceStatus" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ServiceStatus from a dict""" + if obj is None: + return None - object = kwargs.get('object', "ServiceStatus") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'ServiceStatus', + "serviceUp": obj.get("serviceUp"), + "serviceDetails": obj.get("serviceDetails"), + "serviceStatusDownDetails": ServiceStatusDownDetails.from_dict(obj["serviceStatusDownDetails"]) if obj.get("serviceStatusDownDetails") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.service_up = service_up - self.service_details = service_details - self.service_status_down_details = service_status_down_details - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/service_status_down_details.py b/unicourt/model/service_status_down_details.py index 4083a95..720beef 100644 --- a/unicourt/model/service_status_down_details.py +++ b/unicourt/model/service_status_down_details.py @@ -1,306 +1,114 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class ServiceStatusDownDetails(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class ServiceStatusDownDetails(BaseModel): """ + ServiceStatusDownDetails + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=24, strict=True, max_length=24)]] = Field(default='ServiceStatusDownDetails', description="Name of the object") + reason: Optional[StrictStr] = Field(default=None, description="This field determines the reason behind status being down. Following are the possible reason for the service to be down: issueAtTheCourtSource: It means that the court source is either under Scheduled Maintenance or Unplanned Maintenance or Intermittently not responding. notIntegrated: When an court with specific case type is not integrated in UniCourt. brokenIntegration: Due to some updates made to the court site our existing Integration has broken and will require a fix to be made to support this court again for a spcific case type category.") + details: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="Details of the reason.") + eta: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="Estimated Time this Service could be Up again for the use.") + __properties: ClassVar[List[str]] = ["object", "reason", "details", "eta"] + + @field_validator('reason') + def reason_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['issueAtTheCourtSource', 'notIntegrated', 'brokenIntegration']): + raise ValueError("must be one of enum values ('issueAtTheCourtSource', 'notIntegrated', 'brokenIntegration')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - ('reason',): { - 'UNDERMAINTENANCE': "underMaintenance", - 'NOTINTEGRATED': "notIntegrated", - 'BROKENINTEGRATION': "brokenIntegration", - 'SOURCEMIGRATED': "sourceMigrated", - }, - } - - validations = { - ('object',): { - 'max_length': 24, - 'min_length': 24, - }, - ('details',): { - 'max_length': 1000, - }, - ('eta',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ServiceStatusDownDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'reason': (str,), # noqa: E501 - 'details': (str, none_type,), # noqa: E501 - 'eta': (str, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'reason': 'reason', # noqa: E501 - 'details': 'details', # noqa: E501 - 'eta': 'eta', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if details (nullable) is None + # and model_fields_set contains the field + if self.details is None and "details" in self.model_fields_set: + _dict['details'] = None + + # set to None if eta (nullable) is None + # and model_fields_set contains the field + if self.eta is None and "eta" in self.model_fields_set: + _dict['eta'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, reason, details, eta, *args, **kwargs): # noqa: E501 - """ServiceStatusDownDetails - a model defined in OpenAPI - - Args: - reason (str): This field determines the reason behind status being down. Following are the possible reason for the service to be down: underMaintenance: It means that the site is under scheduled maintenance. notIntegrated: When an court with specific case type is not integrated in UniCourt. brokenIntegration: Due to some updates made to the court site our existing Integration has broken and will require a fix to be made to support this court again for a spcific case type category. sourceMigrated: When a source is migrated from one site to another for a specific case type category. - details (str, none_type): Details of the reason. - eta (str, none_type): Estimated Time this Service could be Up again for the use. - - Keyword Args: - object (str): Name of the object. defaults to "ServiceStatusDownDetails" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "ServiceStatusDownDetails") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.reason = reason - self.details = details - self.eta = eta - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, reason, details, eta, *args, **kwargs): # noqa: E501 - """ServiceStatusDownDetails - a model defined in OpenAPI - - Args: - reason (str): This field determines the reason behind status being down. Following are the possible reason for the service to be down: underMaintenance: It means that the site is under scheduled maintenance. notIntegrated: When an court with specific case type is not integrated in UniCourt. brokenIntegration: Due to some updates made to the court site our existing Integration has broken and will require a fix to be made to support this court again for a spcific case type category. sourceMigrated: When a source is migrated from one site to another for a specific case type category. - details (str, none_type): Details of the reason. - eta (str, none_type): Estimated Time this Service could be Up again for the use. - - Keyword Args: - object (str): Name of the object. defaults to "ServiceStatusDownDetails" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ServiceStatusDownDetails from a dict""" + if obj is None: + return None - object = kwargs.get('object', "ServiceStatusDownDetails") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'ServiceStatusDownDetails', + "reason": obj.get("reason"), + "details": obj.get("details"), + "eta": obj.get("eta") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.reason = reason - self.details = details - self.eta = eta - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/similar_norm_attorney.py b/unicourt/model/similar_norm_attorney.py index 931894c..0009c6c 100644 --- a/unicourt/model/similar_norm_attorney.py +++ b/unicourt/model/similar_norm_attorney.py @@ -1,322 +1,106 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.bar_record_preview import BarRecordPreview - globals()['BarRecordPreview'] = BarRecordPreview +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class SimilarNormAttorney(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from unicourt.model.bar_record_preview import BarRecordPreview +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class SimilarNormAttorney(BaseModel): """ + SimilarNormAttorney + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=19, strict=True, max_length=19)]] = 'SimilarNormAttorney' + norm_attorney_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normAttorneyId") + norm_attorney_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="normAttorneyAPI") + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=500)]] = None + norm_attorney_similarity_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="normAttorneySimilarityScore") + bar_record_preview_array: Optional[List[BarRecordPreview]] = Field(default=None, alias="barRecordPreviewArray") + __properties: ClassVar[List[str]] = ["object", "normAttorneyId", "normAttorneyAPI", "name", "normAttorneySimilarityScore", "barRecordPreviewArray"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 19, - 'min_length': 19, - }, - ('norm_attorney_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('norm_attorney_api',): { - 'max_length': 255, - }, - ('name',): { - 'max_length': 500, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SimilarNormAttorney from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'norm_attorney_id': (str,), # noqa: E501 - 'norm_attorney_api': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'norm_attorney_similarity_score': (float,), # noqa: E501 - 'bar_record_preview_array': ([BarRecordPreview],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_attorney_id': 'normAttorneyId', # noqa: E501 - 'norm_attorney_api': 'normAttorneyAPI', # noqa: E501 - 'name': 'name', # noqa: E501 - 'norm_attorney_similarity_score': 'normAttorneySimilarityScore', # noqa: E501 - 'bar_record_preview_array': 'barRecordPreviewArray', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in bar_record_preview_array (list) + _items = [] + if self.bar_record_preview_array: + for _item in self.bar_record_preview_array: + if _item: + _items.append(_item.to_dict()) + _dict['barRecordPreviewArray'] = _items + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_attorney_id, norm_attorney_api, name, norm_attorney_similarity_score, bar_record_preview_array, *args, **kwargs): # noqa: E501 - """SimilarNormAttorney - a model defined in OpenAPI - - Args: - norm_attorney_id (str): - norm_attorney_api (str): - name (str): - norm_attorney_similarity_score (float): - bar_record_preview_array ([BarRecordPreview]): - - Keyword Args: - object (str): defaults to "SimilarNormAttorney" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "SimilarNormAttorney") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_attorney_id = norm_attorney_id - self.norm_attorney_api = norm_attorney_api - self.name = name - self.norm_attorney_similarity_score = norm_attorney_similarity_score - self.bar_record_preview_array = bar_record_preview_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_attorney_id, norm_attorney_api, name, norm_attorney_similarity_score, bar_record_preview_array, *args, **kwargs): # noqa: E501 - """SimilarNormAttorney - a model defined in OpenAPI - - Args: - norm_attorney_id (str): - norm_attorney_api (str): - name (str): - norm_attorney_similarity_score (float): - bar_record_preview_array ([BarRecordPreview]): - - Keyword Args: - object (str): defaults to "SimilarNormAttorney" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SimilarNormAttorney from a dict""" + if obj is None: + return None - object = kwargs.get('object', "SimilarNormAttorney") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'SimilarNormAttorney', + "normAttorneyId": obj.get("normAttorneyId"), + "normAttorneyAPI": obj.get("normAttorneyAPI"), + "name": obj.get("name"), + "normAttorneySimilarityScore": obj.get("normAttorneySimilarityScore"), + "barRecordPreviewArray": [BarRecordPreview.from_dict(_item) for _item in obj["barRecordPreviewArray"]] if obj.get("barRecordPreviewArray") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_attorney_id = norm_attorney_id - self.norm_attorney_api = norm_attorney_api - self.name = name - self.norm_attorney_similarity_score = norm_attorney_similarity_score - self.bar_record_preview_array = bar_record_preview_array - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/sos_associated_norm_organization.py b/unicourt/model/sos_associated_norm_organization.py index 722efe5..9866cc5 100644 --- a/unicourt/model/sos_associated_norm_organization.py +++ b/unicourt/model/sos_associated_norm_organization.py @@ -1,333 +1,126 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class SOSAssociatedNormOrganization(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('relationship_type',): { - 'PARENT': "Parent", - 'CHILD': "Child", - }, - } - - validations = { - ('object',): { - 'max_length': 29, - }, - ('norm_organization_id',): { - 'max_length': 18, - 'min_length': 18, - }, - ('norm_organization_api',): { - 'max_length': 255, - }, - ('relationship_type',): { - 'max_length': 6, - }, - ('name',): { - 'max_length': 500, - }, - ('from_date',): { - 'max_length': 25, - }, - ('to_date',): { - 'max_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'norm_organization_id': (str, none_type,), # noqa: E501 - 'norm_organization_api': (str, none_type,), # noqa: E501 - 'relationship_type': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'from_date': (datetime,), # noqa: E501 - 'to_date': (datetime, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'norm_organization_id': 'normOrganizationId', # noqa: E501 - 'norm_organization_api': 'normOrganizationAPI', # noqa: E501 - 'relationship_type': 'relationshipType', # noqa: E501 - 'name': 'name', # noqa: E501 - 'from_date': 'fromDate', # noqa: E501 - 'to_date': 'toDate', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class SOSAssociatedNormOrganization(BaseModel): + """ + SOSAssociatedNormOrganization + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=29)]] = 'SOSAssociatedNormOrganization' + norm_organization_id: Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]] = Field(default=None, alias="normOrganizationId") + norm_organization_api: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="normOrganizationAPI") + relationship_type: Optional[Annotated[str, Field(strict=True, max_length=6)]] = Field(default=None, alias="relationshipType") + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + from_date: Optional[datetime] = Field(default=None, alias="fromDate") + to_date: Optional[datetime] = Field(default=None, alias="toDate") + __properties: ClassVar[List[str]] = ["object", "normOrganizationId", "normOrganizationAPI", "relationshipType", "name", "fromDate", "toDate"] + + @field_validator('relationship_type') + def relationship_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Parent', 'Child']): + raise ValueError("must be one of enum values ('Parent', 'Child')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, norm_organization_id, norm_organization_api, relationship_type, name, from_date, to_date, *args, **kwargs): # noqa: E501 - """SOSAssociatedNormOrganization - a model defined in OpenAPI - - Args: - norm_organization_id (str, none_type): - norm_organization_api (str, none_type): - relationship_type (str): - name (str): - from_date (datetime): - to_date (datetime, none_type): - - Keyword Args: - object (str): defaults to "SOSAssociatedNormOrganization" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SOSAssociatedNormOrganization from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "SOSAssociatedNormOrganization") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.norm_organization_id = norm_organization_id - self.norm_organization_api = norm_organization_api - self.relationship_type = relationship_type - self.name = name - self.from_date = from_date - self.to_date = to_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, norm_organization_id, norm_organization_api, relationship_type, name, from_date, to_date, *args, **kwargs): # noqa: E501 - """SOSAssociatedNormOrganization - a model defined in OpenAPI - - Args: - norm_organization_id (str, none_type): - norm_organization_api (str, none_type): - relationship_type (str): - name (str): - from_date (datetime): - to_date (datetime, none_type): - - Keyword Args: - object (str): defaults to "SOSAssociatedNormOrganization" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if norm_organization_id (nullable) is None + # and model_fields_set contains the field + if self.norm_organization_id is None and "norm_organization_id" in self.model_fields_set: + _dict['normOrganizationId'] = None + + # set to None if norm_organization_api (nullable) is None + # and model_fields_set contains the field + if self.norm_organization_api is None and "norm_organization_api" in self.model_fields_set: + _dict['normOrganizationAPI'] = None + + # set to None if to_date (nullable) is None + # and model_fields_set contains the field + if self.to_date is None and "to_date" in self.model_fields_set: + _dict['toDate'] = None + + return _dict - object = kwargs.get('object', "SOSAssociatedNormOrganization") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SOSAssociatedNormOrganization from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'SOSAssociatedNormOrganization', + "normOrganizationId": obj.get("normOrganizationId"), + "normOrganizationAPI": obj.get("normOrganizationAPI"), + "relationshipType": obj.get("relationshipType"), + "name": obj.get("name"), + "fromDate": obj.get("fromDate"), + "toDate": obj.get("toDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.norm_organization_id = norm_organization_id - self.norm_organization_api = norm_organization_api - self.relationship_type = relationship_type - self.name = name - self.from_date = from_date - self.to_date = to_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/sos_data.py b/unicourt/model/sos_data.py index ccfc78f..fdb064b 100644 --- a/unicourt/model/sos_data.py +++ b/unicourt/model/sos_data.py @@ -1,413 +1,182 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.associated_so_s_person import AssociatedSoSPerson - from unicourt.model.contact import Contact - from unicourt.model.sos_associated_norm_organization import SOSAssociatedNormOrganization - from unicourt.model.sos_name_change import SOSNameChange - globals()['AssociatedSoSPerson'] = AssociatedSoSPerson - globals()['Contact'] = Contact - globals()['SOSAssociatedNormOrganization'] = SOSAssociatedNormOrganization - globals()['SOSNameChange'] = SOSNameChange - - -class SOSData(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('status',): { - 'None': None, - 'ACTIVE': "Active", - }, - } - - validations = { - ('object',): { - 'max_length': 7, - }, - ('sos_number',): { - 'max_length': 50, - }, - ('state_code',): { - 'max_length': 2, - }, - ('fein',): { - 'max_length': 16, - }, - ('registered_date',): { - 'max_length': 25, - }, - ('status',): { - 'max_length': 10, - }, - ('inactivation_date',): { - 'max_length': 25, - }, - ('first_fetch_date',): { - 'max_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - }, - ('last_fetch_date_with_updates',): { - 'max_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'sos_number': (str, none_type,), # noqa: E501 - 'state_code': (str,), # noqa: E501 - 'fein': (str, none_type,), # noqa: E501 - 'domestic_registration': (bool,), # noqa: E501 - 'registered_date': (datetime, none_type,), # noqa: E501 - 'status': (str, none_type,), # noqa: E501 - 'is_active': (bool,), # noqa: E501 - 'inactivation_date': (datetime, none_type,), # noqa: E501 - 'associated_so_s_person_array': ([AssociatedSoSPerson],), # noqa: E501 - 'contact': (Contact,), # noqa: E501 - 'name_changes_array': ([SOSNameChange],), # noqa: E501 - 'sos_associated_norm_organization_array': ([SOSAssociatedNormOrganization],), # noqa: E501 - 'first_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date': (datetime,), # noqa: E501 - 'last_fetch_date_with_updates': (datetime,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'sos_number': 'sosNumber', # noqa: E501 - 'state_code': 'stateCode', # noqa: E501 - 'fein': 'fein', # noqa: E501 - 'domestic_registration': 'domesticRegistration', # noqa: E501 - 'registered_date': 'registeredDate', # noqa: E501 - 'status': 'status', # noqa: E501 - 'is_active': 'isActive', # noqa: E501 - 'inactivation_date': 'inactivationDate', # noqa: E501 - 'associated_so_s_person_array': 'associatedSoSPersonArray', # noqa: E501 - 'contact': 'contact', # noqa: E501 - 'name_changes_array': 'nameChangesArray', # noqa: E501 - 'sos_associated_norm_organization_array': 'sosAssociatedNormOrganizationArray', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - 'last_fetch_date_with_updates': 'lastFetchDateWithUpdates', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.associated_so_s_person import AssociatedSoSPerson +from unicourt.model.contact import Contact +from unicourt.model.sos_associated_norm_organization import SOSAssociatedNormOrganization +from unicourt.model.sos_name_change import SOSNameChange +from typing import Optional, Set +from typing_extensions import Self + +class SOSData(BaseModel): + """ + SOSData + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=7)]] = 'SOSData' + sos_number: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, alias="sosNumber") + state_code: Optional[Annotated[str, Field(strict=True, max_length=2)]] = Field(default=None, alias="stateCode") + fein: Optional[Annotated[str, Field(strict=True, max_length=16)]] = None + domestic_registration: Optional[StrictBool] = Field(default=True, alias="domesticRegistration") + registered_date: Optional[datetime] = Field(default=None, alias="registeredDate") + status: Optional[Annotated[str, Field(strict=True, max_length=10)]] = None + is_active: Optional[StrictBool] = Field(default=True, alias="isActive") + inactivation_date: Optional[datetime] = Field(default=None, alias="inactivationDate") + associated_so_s_person_array: Optional[List[AssociatedSoSPerson]] = Field(default=None, alias="associatedSoSPersonArray") + contact: Optional[Contact] = None + name_changes_array: Optional[List[SOSNameChange]] = Field(default=None, alias="nameChangesArray") + sos_associated_norm_organization_array: Optional[List[SOSAssociatedNormOrganization]] = Field(default=None, alias="sosAssociatedNormOrganizationArray") + first_fetch_date: Optional[datetime] = Field(default=None, alias="firstFetchDate") + last_fetch_date: Optional[datetime] = Field(default=None, alias="lastFetchDate") + last_fetch_date_with_updates: Optional[datetime] = Field(default=None, description="Last Fetch Date of Organization with Updates.", alias="lastFetchDateWithUpdates") + __properties: ClassVar[List[str]] = ["object", "sosNumber", "stateCode", "fein", "domesticRegistration", "registeredDate", "status", "isActive", "inactivationDate", "associatedSoSPersonArray", "contact", "nameChangesArray", "sosAssociatedNormOrganizationArray", "firstFetchDate", "lastFetchDate", "lastFetchDateWithUpdates"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Active']): + raise ValueError("must be one of enum values ('Active')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, sos_number, state_code, fein, registered_date, inactivation_date, associated_so_s_person_array, contact, name_changes_array, sos_associated_norm_organization_array, first_fetch_date, last_fetch_date, last_fetch_date_with_updates, *args, **kwargs): # noqa: E501 - """SOSData - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SOSData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - sos_number (str, none_type): - state_code (str): - fein (str, none_type): - registered_date (datetime, none_type): - inactivation_date (datetime, none_type): - associated_so_s_person_array ([AssociatedSoSPerson]): - contact (Contact): - name_changes_array ([SOSNameChange]): - sos_associated_norm_organization_array ([SOSAssociatedNormOrganization]): - first_fetch_date (datetime): - last_fetch_date (datetime): - last_fetch_date_with_updates (datetime): Last Fetch Date of Organization with Updates. - - Keyword Args: - object (str): defaults to "SOSData" # noqa: E501 - domestic_registration (bool): defaults to True # noqa: E501 - status (str, none_type): defaults to "Active", must be one of ["Active", ] # noqa: E501 - is_active (bool): defaults to True # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "SOSData") - domestic_registration = kwargs.get('domestic_registration', True) - status = kwargs.get('status', "Active") - is_active = kwargs.get('is_active', True) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.sos_number = sos_number - self.state_code = state_code - self.fein = fein - self.domestic_registration = domestic_registration - self.registered_date = registered_date - self.status = status - self.is_active = is_active - self.inactivation_date = inactivation_date - self.associated_so_s_person_array = associated_so_s_person_array - self.contact = contact - self.name_changes_array = name_changes_array - self.sos_associated_norm_organization_array = sos_associated_norm_organization_array - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.last_fetch_date_with_updates = last_fetch_date_with_updates - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, sos_number, state_code, fein, registered_date, inactivation_date, associated_so_s_person_array, contact, name_changes_array, sos_associated_norm_organization_array, first_fetch_date, last_fetch_date, last_fetch_date_with_updates, *args, **kwargs): # noqa: E501 - """SOSData - a model defined in OpenAPI - - Args: - sos_number (str, none_type): - state_code (str): - fein (str, none_type): - registered_date (datetime, none_type): - inactivation_date (datetime, none_type): - associated_so_s_person_array ([AssociatedSoSPerson]): - contact (Contact): - name_changes_array ([SOSNameChange]): - sos_associated_norm_organization_array ([SOSAssociatedNormOrganization]): - first_fetch_date (datetime): - last_fetch_date (datetime): - last_fetch_date_with_updates (datetime): Last Fetch Date of Organization with Updates. - - Keyword Args: - object (str): defaults to "SOSData" # noqa: E501 - domestic_registration (bool): defaults to True # noqa: E501 - status (str, none_type): defaults to "Active", must be one of ["Active", ] # noqa: E501 - is_active (bool): defaults to True # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in associated_so_s_person_array (list) + _items = [] + if self.associated_so_s_person_array: + for _item in self.associated_so_s_person_array: + if _item: + _items.append(_item.to_dict()) + _dict['associatedSoSPersonArray'] = _items + # override the default output from pydantic by calling `to_dict()` of contact + if self.contact: + _dict['contact'] = self.contact.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in name_changes_array (list) + _items = [] + if self.name_changes_array: + for _item in self.name_changes_array: + if _item: + _items.append(_item.to_dict()) + _dict['nameChangesArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in sos_associated_norm_organization_array (list) + _items = [] + if self.sos_associated_norm_organization_array: + for _item in self.sos_associated_norm_organization_array: + if _item: + _items.append(_item.to_dict()) + _dict['sosAssociatedNormOrganizationArray'] = _items + # set to None if sos_number (nullable) is None + # and model_fields_set contains the field + if self.sos_number is None and "sos_number" in self.model_fields_set: + _dict['sosNumber'] = None + + # set to None if fein (nullable) is None + # and model_fields_set contains the field + if self.fein is None and "fein" in self.model_fields_set: + _dict['fein'] = None + + # set to None if registered_date (nullable) is None + # and model_fields_set contains the field + if self.registered_date is None and "registered_date" in self.model_fields_set: + _dict['registeredDate'] = None + + # set to None if status (nullable) is None + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: + _dict['status'] = None + + # set to None if inactivation_date (nullable) is None + # and model_fields_set contains the field + if self.inactivation_date is None and "inactivation_date" in self.model_fields_set: + _dict['inactivationDate'] = None + + return _dict - object = kwargs.get('object', "SOSData") - domestic_registration = kwargs.get('domestic_registration', True) - status = kwargs.get('status', "Active") - is_active = kwargs.get('is_active', True) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SOSData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'SOSData', + "sosNumber": obj.get("sosNumber"), + "stateCode": obj.get("stateCode"), + "fein": obj.get("fein"), + "domesticRegistration": obj.get("domesticRegistration") if obj.get("domesticRegistration") is not None else True, + "registeredDate": obj.get("registeredDate"), + "status": obj.get("status"), + "isActive": obj.get("isActive") if obj.get("isActive") is not None else True, + "inactivationDate": obj.get("inactivationDate"), + "associatedSoSPersonArray": [AssociatedSoSPerson.from_dict(_item) for _item in obj["associatedSoSPersonArray"]] if obj.get("associatedSoSPersonArray") is not None else None, + "contact": Contact.from_dict(obj["contact"]) if obj.get("contact") is not None else None, + "nameChangesArray": [SOSNameChange.from_dict(_item) for _item in obj["nameChangesArray"]] if obj.get("nameChangesArray") is not None else None, + "sosAssociatedNormOrganizationArray": [SOSAssociatedNormOrganization.from_dict(_item) for _item in obj["sosAssociatedNormOrganizationArray"]] if obj.get("sosAssociatedNormOrganizationArray") is not None else None, + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate"), + "lastFetchDateWithUpdates": obj.get("lastFetchDateWithUpdates") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.sos_number = sos_number - self.state_code = state_code - self.fein = fein - self.domestic_registration = domestic_registration - self.registered_date = registered_date - self.status = status - self.is_active = is_active - self.inactivation_date = inactivation_date - self.associated_so_s_person_array = associated_so_s_person_array - self.contact = contact - self.name_changes_array = name_changes_array - self.sos_associated_norm_organization_array = sos_associated_norm_organization_array - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - self.last_fetch_date_with_updates = last_fetch_date_with_updates - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/sos_data_preview.py b/unicourt/model/sos_data_preview.py index bed0945..86653c6 100644 --- a/unicourt/model/sos_data_preview.py +++ b/unicourt/model/sos_data_preview.py @@ -1,292 +1,92 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class SOSDataPreview(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 14, - }, - ('sos_number',): { - 'max_length': 250, - }, - ('state_code',): { - 'max_length': 2, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'sos_number': (str,), # noqa: E501 - 'state_code': (str,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class SOSDataPreview(BaseModel): + """ + SOSDataPreview + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=14)]] = 'SOSDataPreview' + sos_number: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, alias="sosNumber") + state_code: Optional[Annotated[str, Field(strict=True, max_length=2)]] = Field(default=None, alias="stateCode") + __properties: ClassVar[List[str]] = ["object", "sosNumber", "stateCode"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'object': 'object', # noqa: E501 - 'sos_number': 'sosNumber', # noqa: E501 - 'state_code': 'stateCode', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, sos_number, state_code, *args, **kwargs): # noqa: E501 - """SOSDataPreview - a model defined in OpenAPI - - Args: - sos_number (str): - state_code (str): - - Keyword Args: - object (str): defaults to "SOSDataPreview" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SOSDataPreview from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "SOSDataPreview") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.sos_number = sos_number - self.state_code = state_code - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, sos_number, state_code, *args, **kwargs): # noqa: E501 - """SOSDataPreview - a model defined in OpenAPI + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - Args: - sos_number (str): - state_code (str): + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict - Keyword Args: - object (str): defaults to "SOSDataPreview" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SOSDataPreview from a dict""" + if obj is None: + return None - object = kwargs.get('object', "SOSDataPreview") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'SOSDataPreview', + "sosNumber": obj.get("sosNumber"), + "stateCode": obj.get("stateCode") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.sos_number = sos_number - self.state_code = state_code - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/sos_name_change.py b/unicourt/model/sos_name_change.py index 2dd2a7d..fe4213a 100644 --- a/unicourt/model/sos_name_change.py +++ b/unicourt/model/sos_name_change.py @@ -1,301 +1,105 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -class SOSNameChange(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Do not edit the class manually. +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class SOSNameChange(BaseModel): """ + SOSNameChange + """ # noqa: E501 + object: Optional[Annotated[str, Field(strict=True, max_length=13)]] = 'SOSNameChange' + name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = None + from_date: Optional[datetime] = Field(default=None, alias="fromDate") + to_date: Optional[datetime] = Field(default=None, alias="toDate") + __properties: ClassVar[List[str]] = ["object", "name", "fromDate", "toDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 13, - }, - ('name',): { - 'max_length': 500, - }, - ('from_date',): { - 'max_length': 25, - }, - ('to_date',): { - 'max_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SOSNameChange from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = False + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return { - 'object': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'from_date': (datetime, none_type,), # noqa: E501 - 'to_date': (datetime, none_type,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'name': 'name', # noqa: E501 - 'from_date': 'fromDate', # noqa: E501 - 'to_date': 'toDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if from_date (nullable) is None + # and model_fields_set contains the field + if self.from_date is None and "from_date" in self.model_fields_set: + _dict['fromDate'] = None + + # set to None if to_date (nullable) is None + # and model_fields_set contains the field + if self.to_date is None and "to_date" in self.model_fields_set: + _dict['toDate'] = None + + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, name, from_date, to_date, *args, **kwargs): # noqa: E501 - """SOSNameChange - a model defined in OpenAPI - - Args: - name (str): - from_date (datetime, none_type): - to_date (datetime, none_type): - - Keyword Args: - object (str): defaults to "SOSNameChange" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "SOSNameChange") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.name = name - self.from_date = from_date - self.to_date = to_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, name, from_date, to_date, *args, **kwargs): # noqa: E501 - """SOSNameChange - a model defined in OpenAPI - - Args: - name (str): - from_date (datetime, none_type): - to_date (datetime, none_type): - - Keyword Args: - object (str): defaults to "SOSNameChange" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SOSNameChange from a dict""" + if obj is None: + return None - object = kwargs.get('object', "SOSNameChange") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'SOSNameChange', + "name": obj.get("name"), + "fromDate": obj.get("fromDate"), + "toDate": obj.get("toDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.name = name - self.from_date = from_date - self.to_date = to_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/source_case_data.py b/unicourt/model/source_case_data.py index 11327f5..2993ae3 100644 --- a/unicourt/model/source_case_data.py +++ b/unicourt/model/source_case_data.py @@ -1,338 +1,134 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.nature_of_suit import NatureOfSuit - from unicourt.model.source_cause_of_action import SourceCauseOfAction - from unicourt.model.source_charge import SourceCharge - from unicourt.model.source_page_data import SourcePageData - globals()['NatureOfSuit'] = NatureOfSuit - globals()['SourceCauseOfAction'] = SourceCauseOfAction - globals()['SourceCharge'] = SourceCharge - globals()['SourcePageData'] = SourcePageData - - -class SourceCaseData(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 14, - 'min_length': 14, - }, - ('source_court',): { - 'max_length': 250, - }, - ('source_case_type',): { - 'max_length': 250, - }, - ('source_case_status',): { - 'max_length': 250, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'source_court': (str,), # noqa: E501 - 'source_case_type': (str,), # noqa: E501 - 'source_charge_array': ([SourceCharge],), # noqa: E501 - 'nature_of_suit_array': ([NatureOfSuit],), # noqa: E501 - 'source_cause_of_action_array': ([SourceCauseOfAction],), # noqa: E501 - 'source_case_status': (str,), # noqa: E501 - 'source_page_data': ([SourcePageData],), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'source_court': 'sourceCourt', # noqa: E501 - 'source_case_type': 'sourceCaseType', # noqa: E501 - 'source_charge_array': 'sourceChargeArray', # noqa: E501 - 'nature_of_suit_array': 'natureOfSuitArray', # noqa: E501 - 'source_cause_of_action_array': 'sourceCauseOfActionArray', # noqa: E501 - 'source_case_status': 'sourceCaseStatus', # noqa: E501 - 'source_page_data': 'sourcePageData', # noqa: E501 - } - read_only_vars = { - } - - _composed_schemas = {} +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.nature_of_suit import NatureOfSuit +from unicourt.model.source_cause_of_action import SourceCauseOfAction +from unicourt.model.source_charge import SourceCharge +from unicourt.model.source_page_data import SourcePageData +from typing import Optional, Set +from typing_extensions import Self + +class SourceCaseData(BaseModel): + """ + Source data in the court website. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=14, strict=True, max_length=14)]] = Field(default='SourceCaseData', description="Name of the object") + source_court: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="Courtrhouse as provided by Court.", alias="sourceCourt") + source_case_type: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="Case Type for a case which is provided by the Court.", alias="sourceCaseType") + source_charge_array: Optional[List[SourceCharge]] = Field(default=None, description="Array of Charges for a case which is provided by the Court.", alias="sourceChargeArray") + nature_of_suit_array: Optional[List[NatureOfSuit]] = Field(default=None, description="Array of Charges for a case which is provided by the Court.", alias="natureOfSuitArray") + source_cause_of_action_array: Optional[List[SourceCauseOfAction]] = Field(default=None, description="Array of Cause Of Action for a case which is provided by the Court.", alias="sourceCauseOfActionArray") + source_case_status: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="Case Status as provided by Court.", alias="sourceCaseStatus") + source_page_data: Optional[List[SourcePageData]] = Field(default=None, alias="sourcePageData") + __properties: ClassVar[List[str]] = ["object", "sourceCourt", "sourceCaseType", "sourceChargeArray", "natureOfSuitArray", "sourceCauseOfActionArray", "sourceCaseStatus", "sourcePageData"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, source_court, source_case_type, source_charge_array, nature_of_suit_array, source_cause_of_action_array, source_case_status, source_page_data, *args, **kwargs): # noqa: E501 - """SourceCaseData - a model defined in OpenAPI + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SourceCaseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - Args: - source_court (str): Courtrhouse as provided by Court. - source_case_type (str): Case Type for a case which is provided by the Court. - source_charge_array ([SourceCharge]): Array of Charges for a case which is provided by the Court. - nature_of_suit_array ([NatureOfSuit]): Array of Charges for a case which is provided by the Court. - source_cause_of_action_array ([SourceCauseOfAction]): Array of Cause Of Action for a case which is provided by the Court. - source_case_status (str): Case Status as provided by Court. - source_page_data ([SourcePageData]): - - Keyword Args: - object (str): Name of the object. defaults to "SourceCaseData" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - object = kwargs.get('object', "SourceCaseData") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.source_court = source_court - self.source_case_type = source_case_type - self.source_charge_array = source_charge_array - self.nature_of_suit_array = nature_of_suit_array - self.source_cause_of_action_array = source_cause_of_action_array - self.source_case_status = source_case_status - self.source_page_data = source_page_data - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, source_court, source_case_type, source_charge_array, nature_of_suit_array, source_cause_of_action_array, source_case_status, source_page_data, *args, **kwargs): # noqa: E501 - """SourceCaseData - a model defined in OpenAPI - - Args: - source_court (str): Courtrhouse as provided by Court. - source_case_type (str): Case Type for a case which is provided by the Court. - source_charge_array ([SourceCharge]): Array of Charges for a case which is provided by the Court. - nature_of_suit_array ([NatureOfSuit]): Array of Charges for a case which is provided by the Court. - source_cause_of_action_array ([SourceCauseOfAction]): Array of Cause Of Action for a case which is provided by the Court. - source_case_status (str): Case Status as provided by Court. - source_page_data ([SourcePageData]): - - Keyword Args: - object (str): Name of the object. defaults to "SourceCaseData" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in source_charge_array (list) + _items = [] + if self.source_charge_array: + for _item in self.source_charge_array: + if _item: + _items.append(_item.to_dict()) + _dict['sourceChargeArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in nature_of_suit_array (list) + _items = [] + if self.nature_of_suit_array: + for _item in self.nature_of_suit_array: + if _item: + _items.append(_item.to_dict()) + _dict['natureOfSuitArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in source_cause_of_action_array (list) + _items = [] + if self.source_cause_of_action_array: + for _item in self.source_cause_of_action_array: + if _item: + _items.append(_item.to_dict()) + _dict['sourceCauseOfActionArray'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in source_page_data (list) + _items = [] + if self.source_page_data: + for _item in self.source_page_data: + if _item: + _items.append(_item.to_dict()) + _dict['sourcePageData'] = _items + return _dict - object = kwargs.get('object', "SourceCaseData") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SourceCaseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'SourceCaseData', + "sourceCourt": obj.get("sourceCourt"), + "sourceCaseType": obj.get("sourceCaseType"), + "sourceChargeArray": [SourceCharge.from_dict(_item) for _item in obj["sourceChargeArray"]] if obj.get("sourceChargeArray") is not None else None, + "natureOfSuitArray": [NatureOfSuit.from_dict(_item) for _item in obj["natureOfSuitArray"]] if obj.get("natureOfSuitArray") is not None else None, + "sourceCauseOfActionArray": [SourceCauseOfAction.from_dict(_item) for _item in obj["sourceCauseOfActionArray"]] if obj.get("sourceCauseOfActionArray") is not None else None, + "sourceCaseStatus": obj.get("sourceCaseStatus"), + "sourcePageData": [SourcePageData.from_dict(_item) for _item in obj["sourcePageData"]] if obj.get("sourcePageData") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.source_court = source_court - self.source_case_type = source_case_type - self.source_charge_array = source_charge_array - self.nature_of_suit_array = nature_of_suit_array - self.source_cause_of_action_array = source_cause_of_action_array - self.source_case_status = source_case_status - self.source_page_data = source_page_data - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/source_cause_of_action.py b/unicourt/model/source_cause_of_action.py index a1a42f1..4623862 100644 --- a/unicourt/model/source_cause_of_action.py +++ b/unicourt/model/source_cause_of_action.py @@ -1,328 +1,115 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class SourceCauseOfAction(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 19, - 'min_length': 19, - }, - ('source_cause_of_action_raw',): { - 'max_length': 500, - }, - ('source_cause_of_action',): { - 'max_length': 250, - }, - ('source_statute',): { - 'max_length': 250, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'is_visible': (bool,), # noqa: E501 - 'source_cause_of_action_raw': (str, none_type,), # noqa: E501 - 'source_cause_of_action': (str, none_type,), # noqa: E501 - 'source_statute': (str, none_type,), # noqa: E501 - 'first_fetch_date': (str,), # noqa: E501 - 'last_fetch_date': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'is_visible': 'isVisible', # noqa: E501 - 'source_cause_of_action_raw': 'sourceCauseOfActionRaw', # noqa: E501 - 'source_cause_of_action': 'sourceCauseOfAction', # noqa: E501 - 'source_statute': 'sourceStatute', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class SourceCauseOfAction(BaseModel): + """ + Source Cause of Action data from the source site. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=19, strict=True, max_length=19)]] = Field(default='SourceCauseOfAction', description="Name of the object") + is_visible: Optional[StrictBool] = Field(default=None, description="Signifies if the cause of action is currently isVisible or not for the case.", alias="isVisible") + source_cause_of_action_raw: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="Raw Cause of Action data from the source site.", alias="sourceCauseOfActionRaw") + source_cause_of_action: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="Cause of Action data from the source site.", alias="sourceCauseOfAction") + source_statute: Optional[Annotated[str, Field(strict=True, max_length=250)]] = Field(default=None, description="Statute of a Cause of Action.", alias="sourceStatute") + first_fetch_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="When this Cause of Action was first fetched from the court site.", alias="firstFetchDate") + last_fetch_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="When this Cause of Action was last fetched from the court site.", alias="lastFetchDate") + __properties: ClassVar[List[str]] = ["object", "isVisible", "sourceCauseOfActionRaw", "sourceCauseOfAction", "sourceStatute", "firstFetchDate", "lastFetchDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, is_visible, source_cause_of_action_raw, source_cause_of_action, source_statute, first_fetch_date, last_fetch_date, *args, **kwargs): # noqa: E501 - """SourceCauseOfAction - a model defined in OpenAPI - - Args: - is_visible (bool): Signifies if the cause of action is currently isVisible or not for the case. - source_cause_of_action_raw (str, none_type): Raw Cause of Action data from the source site. - source_cause_of_action (str, none_type): Cause of Action data from the source site. - source_statute (str, none_type): Statute of a Cause of Action. - first_fetch_date (str): When this Cause of Action was first fetched from the court site. - last_fetch_date (str): When this Cause of Action was last fetched from the court site. - - Keyword Args: - object (str): Name of the object. defaults to "SourceCauseOfAction" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SourceCauseOfAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "SourceCauseOfAction") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.is_visible = is_visible - self.source_cause_of_action_raw = source_cause_of_action_raw - self.source_cause_of_action = source_cause_of_action - self.source_statute = source_statute - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, is_visible, source_cause_of_action_raw, source_cause_of_action, source_statute, first_fetch_date, last_fetch_date, *args, **kwargs): # noqa: E501 - """SourceCauseOfAction - a model defined in OpenAPI - - Args: - is_visible (bool): Signifies if the cause of action is currently isVisible or not for the case. - source_cause_of_action_raw (str, none_type): Raw Cause of Action data from the source site. - source_cause_of_action (str, none_type): Cause of Action data from the source site. - source_statute (str, none_type): Statute of a Cause of Action. - first_fetch_date (str): When this Cause of Action was first fetched from the court site. - last_fetch_date (str): When this Cause of Action was last fetched from the court site. - - Keyword Args: - object (str): Name of the object. defaults to "SourceCauseOfAction" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if source_cause_of_action_raw (nullable) is None + # and model_fields_set contains the field + if self.source_cause_of_action_raw is None and "source_cause_of_action_raw" in self.model_fields_set: + _dict['sourceCauseOfActionRaw'] = None + + # set to None if source_cause_of_action (nullable) is None + # and model_fields_set contains the field + if self.source_cause_of_action is None and "source_cause_of_action" in self.model_fields_set: + _dict['sourceCauseOfAction'] = None + + # set to None if source_statute (nullable) is None + # and model_fields_set contains the field + if self.source_statute is None and "source_statute" in self.model_fields_set: + _dict['sourceStatute'] = None + + return _dict - object = kwargs.get('object', "SourceCauseOfAction") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SourceCauseOfAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'SourceCauseOfAction', + "isVisible": obj.get("isVisible"), + "sourceCauseOfActionRaw": obj.get("sourceCauseOfActionRaw"), + "sourceCauseOfAction": obj.get("sourceCauseOfAction"), + "sourceStatute": obj.get("sourceStatute"), + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.is_visible = is_visible - self.source_cause_of_action_raw = source_cause_of_action_raw - self.source_cause_of_action = source_cause_of_action - self.source_statute = source_statute - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/source_charge.py b/unicourt/model/source_charge.py index 7ed3ddd..543ab72 100644 --- a/unicourt/model/source_charge.py +++ b/unicourt/model/source_charge.py @@ -1,358 +1,134 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.source_charge_additional_data import SourceChargeAdditionalData - globals()['SourceChargeAdditionalData'] = SourceChargeAdditionalData - - -class SourceCharge(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 12, - 'min_length': 12, - }, - ('source_charge_raw',): { - 'max_length': 255, - }, - ('source_charge',): { - 'max_length': 255, - }, - ('source_statute',): { - 'max_length': 50, - }, - ('source_charge_degree',): { - 'max_length': 255, - }, - ('source_charge_severity',): { - 'max_length': 255, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'source_charge_raw': (str,), # noqa: E501 - 'source_charge': (str, none_type,), # noqa: E501 - 'is_visible': (bool,), # noqa: E501 - 'source_statute': (str, none_type,), # noqa: E501 - 'source_charge_degree': (str, none_type,), # noqa: E501 - 'source_charge_severity': (str, none_type,), # noqa: E501 - 'source_charge_additional_data_array': ([SourceChargeAdditionalData],), # noqa: E501 - 'first_fetch_date': (str,), # noqa: E501 - 'last_fetch_date': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None +""" # noqa: E501 - attribute_map = { - 'object': 'object', # noqa: E501 - 'source_charge_raw': 'sourceChargeRaw', # noqa: E501 - 'source_charge': 'sourceCharge', # noqa: E501 - 'is_visible': 'isVisible', # noqa: E501 - 'source_statute': 'sourceStatute', # noqa: E501 - 'source_charge_degree': 'sourceChargeDegree', # noqa: E501 - 'source_charge_severity': 'sourceChargeSeverity', # noqa: E501 - 'source_charge_additional_data_array': 'sourceChargeAdditionalDataArray', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - } +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - read_only_vars = { - } +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.source_charge_additional_data import SourceChargeAdditionalData +from typing import Optional, Set +from typing_extensions import Self - _composed_schemas = {} +class SourceCharge(BaseModel): + """ + Source charge data from the source site. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=12, strict=True, max_length=12)]] = Field(default='SourceCharge', description="Name of the object") + source_charge_raw: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Raw charge data from the source site.", alias="sourceChargeRaw") + source_charge: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Charge data from the source site.", alias="sourceCharge") + is_visible: Optional[StrictBool] = Field(default=None, description="Signifies if the charge is currently isVisible or not for the case.", alias="isVisible") + source_statute: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="Statute of a charge.", alias="sourceStatute") + source_charge_degree: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Charge degree data from the source site.", alias="sourceChargeDegree") + source_charge_severity: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Charge severity data from the source site.", alias="sourceChargeSeverity") + source_charge_additional_data_array: Optional[List[SourceChargeAdditionalData]] = Field(default=None, description="Additional data related to the charge which is available in the source site.", alias="sourceChargeAdditionalDataArray") + first_fetch_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="When this charge was first fetched from the court site.", alias="firstFetchDate") + last_fetch_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="When this charge was last fetched from the court site.", alias="lastFetchDate") + __properties: ClassVar[List[str]] = ["object", "sourceChargeRaw", "sourceCharge", "isVisible", "sourceStatute", "sourceChargeDegree", "sourceChargeSeverity", "sourceChargeAdditionalDataArray", "firstFetchDate", "lastFetchDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, source_charge_raw, source_charge, is_visible, source_statute, source_charge_degree, source_charge_severity, source_charge_additional_data_array, first_fetch_date, last_fetch_date, *args, **kwargs): # noqa: E501 - """SourceCharge - a model defined in OpenAPI - - Args: - source_charge_raw (str): Raw charge data from the source site. - source_charge (str, none_type): Charge data from the source site. - is_visible (bool): Signifies if the charge is currently isVisible or not for the case. - source_statute (str, none_type): Statute of a charge. - source_charge_degree (str, none_type): Charge degree data from the source site. - source_charge_severity (str, none_type): Charge severity data from the source site. - source_charge_additional_data_array ([SourceChargeAdditionalData]): Additional data related to the charge which is available in the source site. - first_fetch_date (str): When this charge was first fetched from the court site. - last_fetch_date (str): When this charge was last fetched from the court site. - - Keyword Args: - object (str): Name of the object. defaults to "SourceCharge" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "SourceCharge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SourceCharge from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self.object = object - self.source_charge_raw = source_charge_raw - self.source_charge = source_charge - self.is_visible = is_visible - self.source_statute = source_statute - self.source_charge_degree = source_charge_degree - self.source_charge_severity = source_charge_severity - self.source_charge_additional_data_array = source_charge_additional_data_array - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - @convert_js_args_to_python_args - def __init__(self, source_charge_raw, source_charge, is_visible, source_statute, source_charge_degree, source_charge_severity, source_charge_additional_data_array, first_fetch_date, last_fetch_date, *args, **kwargs): # noqa: E501 - """SourceCharge - a model defined in OpenAPI - - Args: - source_charge_raw (str): Raw charge data from the source site. - source_charge (str, none_type): Charge data from the source site. - is_visible (bool): Signifies if the charge is currently isVisible or not for the case. - source_statute (str, none_type): Statute of a charge. - source_charge_degree (str, none_type): Charge degree data from the source site. - source_charge_severity (str, none_type): Charge severity data from the source site. - source_charge_additional_data_array ([SourceChargeAdditionalData]): Additional data related to the charge which is available in the source site. - first_fetch_date (str): When this charge was first fetched from the court site. - last_fetch_date (str): When this charge was last fetched from the court site. - - Keyword Args: - object (str): Name of the object. defaults to "SourceCharge" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in source_charge_additional_data_array (list) + _items = [] + if self.source_charge_additional_data_array: + for _item in self.source_charge_additional_data_array: + if _item: + _items.append(_item.to_dict()) + _dict['sourceChargeAdditionalDataArray'] = _items + # set to None if source_charge (nullable) is None + # and model_fields_set contains the field + if self.source_charge is None and "source_charge" in self.model_fields_set: + _dict['sourceCharge'] = None + + # set to None if source_statute (nullable) is None + # and model_fields_set contains the field + if self.source_statute is None and "source_statute" in self.model_fields_set: + _dict['sourceStatute'] = None + + # set to None if source_charge_degree (nullable) is None + # and model_fields_set contains the field + if self.source_charge_degree is None and "source_charge_degree" in self.model_fields_set: + _dict['sourceChargeDegree'] = None + + # set to None if source_charge_severity (nullable) is None + # and model_fields_set contains the field + if self.source_charge_severity is None and "source_charge_severity" in self.model_fields_set: + _dict['sourceChargeSeverity'] = None + + return _dict - object = kwargs.get('object', "SourceCharge") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SourceCharge from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'SourceCharge', + "sourceChargeRaw": obj.get("sourceChargeRaw"), + "sourceCharge": obj.get("sourceCharge"), + "isVisible": obj.get("isVisible"), + "sourceStatute": obj.get("sourceStatute"), + "sourceChargeDegree": obj.get("sourceChargeDegree"), + "sourceChargeSeverity": obj.get("sourceChargeSeverity"), + "sourceChargeAdditionalDataArray": [SourceChargeAdditionalData.from_dict(_item) for _item in obj["sourceChargeAdditionalDataArray"]] if obj.get("sourceChargeAdditionalDataArray") is not None else None, + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.source_charge_raw = source_charge_raw - self.source_charge = source_charge - self.is_visible = is_visible - self.source_statute = source_statute - self.source_charge_degree = source_charge_degree - self.source_charge_severity = source_charge_severity - self.source_charge_additional_data_array = source_charge_additional_data_array - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/source_charge_additional_data.py b/unicourt/model/source_charge_additional_data.py index fabfab3..c9ba79f 100644 --- a/unicourt/model/source_charge_additional_data.py +++ b/unicourt/model/source_charge_additional_data.py @@ -1,293 +1,97 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class SourceChargeAdditionalData(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 26, - 'min_length': 26, - }, - ('type',): { - 'max_length': 255, - }, - ('value',): { - 'max_length': 255, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - _nullable = True - - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'value': (str, none_type,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class SourceChargeAdditionalData(BaseModel): + """ + Additional data that enchances the information of a given charge. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=26, strict=True, max_length=26)]] = Field(default='SourceChargeAdditionalData', description="Name of the object") + type: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Describes what type of additional data.") + value: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Value of additional data.") + __properties: ClassVar[List[str]] = ["object", "type", "value"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'object': 'object', # noqa: E501 - 'type': 'type', # noqa: E501 - 'value': 'value', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, type, value, *args, **kwargs): # noqa: E501 - """SourceChargeAdditionalData - a model defined in OpenAPI - - Args: - type (str): Describes what type of additional data. - value (str, none_type): Value of additional data. - - Keyword Args: - object (str): Name of the object. defaults to "SourceChargeAdditionalData" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "SourceChargeAdditionalData") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SourceChargeAdditionalData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self.object = object - self.type = type - self.value = value - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - @convert_js_args_to_python_args - def __init__(self, type, value, *args, **kwargs): # noqa: E501 - """SourceChargeAdditionalData - a model defined in OpenAPI + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if value (nullable) is None + # and model_fields_set contains the field + if self.value is None and "value" in self.model_fields_set: + _dict['value'] = None - Args: - type (str): Describes what type of additional data. - value (str, none_type): Value of additional data. + return _dict - Keyword Args: - object (str): Name of the object. defaults to "SourceChargeAdditionalData" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SourceChargeAdditionalData from a dict""" + if obj is None: + return None - object = kwargs.get('object', "SourceChargeAdditionalData") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'SourceChargeAdditionalData', + "type": obj.get("type"), + "value": obj.get("value") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.type = type - self.value = value - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/source_page_data.py b/unicourt/model/source_page_data.py index 6dde320..6946b39 100644 --- a/unicourt/model/source_page_data.py +++ b/unicourt/model/source_page_data.py @@ -1,316 +1,100 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -def lazy_import(): - from unicourt.model.source_structured_data import SourceStructuredData - globals()['SourceStructuredData'] = SourceStructuredData +from __future__ import annotations +import pprint +import re # noqa: F401 +import json -class SourcePageData(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from unicourt.model.source_structured_data import SourceStructuredData +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. +class SourcePageData(BaseModel): """ + Source data from different pages in the court website. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=14, strict=True, max_length=14)]] = Field(default='SourcePageData', description="Name of the object") + page_name: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="Pages supported for PACER pacerCaseQuery, pacerDocketReport, pacerCaseSummary, pacerAssociatedCases, pacerCaseLocatorResults, hearing, relatedCases.", alias="pageName") + additional_source_data: Optional[SourceStructuredData] = Field(default=None, alias="additionalSourceData") + first_fetch_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="When was the page first fetched from the court site.", alias="firstFetchDate") + last_fetch_date: Optional[Annotated[str, Field(min_length=25, strict=True, max_length=25)]] = Field(default=None, description="When was the page last fetched from the court site.", alias="lastFetchDate") + __properties: ClassVar[List[str]] = ["object", "pageName", "additionalSourceData", "firstFetchDate", "lastFetchDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 14, - 'min_length': 14, - }, - ('page_name',): { - 'max_length': 100, - }, - ('first_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - ('last_fetch_date',): { - 'max_length': 25, - 'min_length': 25, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SourcePageData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _nullable = True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - lazy_import() - return { - 'object': (str,), # noqa: E501 - 'page_name': (str,), # noqa: E501 - 'additional_source_data': (SourceStructuredData,), # noqa: E501 - 'first_fetch_date': (str,), # noqa: E501 - 'last_fetch_date': (str,), # noqa: E501 - } - - @cached_property - def discriminator(): - return None - - - attribute_map = { - 'object': 'object', # noqa: E501 - 'page_name': 'pageName', # noqa: E501 - 'additional_source_data': 'additionalSourceData', # noqa: E501 - 'first_fetch_date': 'firstFetchDate', # noqa: E501 - 'last_fetch_date': 'lastFetchDate', # noqa: E501 - } - - read_only_vars = { - } - - _composed_schemas = {} + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of additional_source_data + if self.additional_source_data: + _dict['additionalSourceData'] = self.additional_source_data.to_dict() + return _dict @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, page_name, additional_source_data, first_fetch_date, last_fetch_date, *args, **kwargs): # noqa: E501 - """SourcePageData - a model defined in OpenAPI - - Args: - page_name (str): Pages supported for PACER pacerCaseQuery, pacerDocketReport, pacerCaseSummary, pacerAssociatedCases, pacerCaseLocatorResults, hearing, relatedCases. - additional_source_data (SourceStructuredData): - first_fetch_date (str): When was the page first fetched from the court site. - last_fetch_date (str): When was the page last fetched from the court site. - - Keyword Args: - object (str): Name of the object. defaults to "SourcePageData" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ - - object = kwargs.get('object', "SourcePageData") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) - - self = super(OpenApiModel, cls).__new__(cls) - - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.page_name = page_name - self.additional_source_data = additional_source_data - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, page_name, additional_source_data, first_fetch_date, last_fetch_date, *args, **kwargs): # noqa: E501 - """SourcePageData - a model defined in OpenAPI - - Args: - page_name (str): Pages supported for PACER pacerCaseQuery, pacerDocketReport, pacerCaseSummary, pacerAssociatedCases, pacerCaseLocatorResults, hearing, relatedCases. - additional_source_data (SourceStructuredData): - first_fetch_date (str): When was the page first fetched from the court site. - last_fetch_date (str): When was the page last fetched from the court site. - - Keyword Args: - object (str): Name of the object. defaults to "SourcePageData" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SourcePageData from a dict""" + if obj is None: + return None - object = kwargs.get('object', "SourcePageData") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'SourcePageData', + "pageName": obj.get("pageName"), + "additionalSourceData": SourceStructuredData.from_dict(obj["additionalSourceData"]) if obj.get("additionalSourceData") is not None else None, + "firstFetchDate": obj.get("firstFetchDate"), + "lastFetchDate": obj.get("lastFetchDate") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.page_name = page_name - self.additional_source_data = additional_source_data - self.first_fetch_date = first_fetch_date - self.last_fetch_date = last_fetch_date - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/source_structured_data.py b/unicourt/model/source_structured_data.py index 10fd045..b9847b8 100644 --- a/unicourt/model/source_structured_data.py +++ b/unicourt/model/source_structured_data.py @@ -1,283 +1,101 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - -def lazy_import(): - from unicourt.model.extracted_fields import ExtractedFields - from unicourt.model.raw_ordered_data import RawOrderedData - globals()['ExtractedFields'] = ExtractedFields - globals()['RawOrderedData'] = RawOrderedData - - -class SourceStructuredData(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = True - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - lazy_import() - return { - 'raw_ordered_data_array': ([RawOrderedData],), # noqa: E501 - 'extracted_fields': (ExtractedFields,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from unicourt.model.extracted_fields import ExtractedFields +from unicourt.model.raw_ordered_data import RawOrderedData +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class SourceStructuredData(BaseModel): + """ + SourceStructuredData + """ # noqa: E501 + raw_ordered_data_array: Optional[List[RawOrderedData]] = Field(default=None, alias="rawOrderedDataArray") + extracted_fields: Optional[ExtractedFields] = Field(default=None, alias="extractedFields") + __properties: ClassVar[List[str]] = ["rawOrderedDataArray", "extractedFields"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'raw_ordered_data_array': 'rawOrderedDataArray', # noqa: E501 - 'extracted_fields': 'extractedFields', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, raw_ordered_data_array, extracted_fields, *args, **kwargs): # noqa: E501 - """SourceStructuredData - a model defined in OpenAPI - - Args: - raw_ordered_data_array ([RawOrderedData]): - extracted_fields (ExtractedFields): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SourceStructuredData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.raw_ordered_data_array = raw_ordered_data_array - self.extracted_fields = extracted_fields - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, raw_ordered_data_array, extracted_fields, *args, **kwargs): # noqa: E501 - """SourceStructuredData - a model defined in OpenAPI - - Args: - raw_ordered_data_array ([RawOrderedData]): - extracted_fields (ExtractedFields): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in raw_ordered_data_array (list) + _items = [] + if self.raw_ordered_data_array: + for _item in self.raw_ordered_data_array: + if _item: + _items.append(_item.to_dict()) + _dict['rawOrderedDataArray'] = _items + # override the default output from pydantic by calling `to_dict()` of extracted_fields + if self.extracted_fields: + _dict['extractedFields'] = self.extracted_fields.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SourceStructuredData from a dict""" + if obj is None: + return None - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "rawOrderedDataArray": [RawOrderedData.from_dict(_item) for _item in obj["rawOrderedDataArray"]] if obj.get("rawOrderedDataArray") is not None else None, + "extractedFields": ExtractedFields.from_dict(obj["extractedFields"]) if obj.get("extractedFields") is not None else None + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.raw_ordered_data_array = raw_ordered_data_array - self.extracted_fields = extracted_fields - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model/success.py b/unicourt/model/success.py index c4524f0..4d870cf 100644 --- a/unicourt/model/success.py +++ b/unicourt/model/success.py @@ -1,285 +1,90 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from unicourt.model_utils import ( # noqa: F401 - ApiTypeError, - ModelComposed, - ModelNormal, - ModelSimple, - cached_property, - change_keys_js_to_python, - convert_js_args_to_python_args, - date, - datetime, - file_type, - none_type, - validate_get_composed_info, - OpenApiModel -) -from unicourt.exceptions import ApiAttributeError - - - -class Success(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. +""" # noqa: E501 - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - validations = { - ('object',): { - 'max_length': 7, - 'min_length': 7, - }, - ('message',): { - 'max_length': 255, - 'min_length': 1, - }, - } - - @cached_property - def additional_properties_type(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded - """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - _nullable = False - @cached_property - def openapi_types(): - """ - This must be a method because a model may have properties that are - of type self, this must run after the class is loaded +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Returns - openapi_types (dict): The key is attribute name - and the value is attribute type. - """ - return { - 'object': (str,), # noqa: E501 - 'message': (str,), # noqa: E501 - } +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - @cached_property - def discriminator(): - return None +class Success(BaseModel): + """ + Success object contains its message related to the API request. + """ # noqa: E501 + object: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=7)]] = 'Success' + message: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="A message indicating that the request was successful.") + __properties: ClassVar[List[str]] = ["object", "message"] + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'object': 'object', # noqa: E501 - 'message': 'message', # noqa: E501 - } - read_only_vars = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - _composed_schemas = {} + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) @classmethod - @convert_js_args_to_python_args - def _from_openapi_data(cls, message, *args, **kwargs): # noqa: E501 - """Success - a model defined in OpenAPI - - Args: - message (str): A message indicating that the request was successful. - - Keyword Args: - object (str): defaults to "Success" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Success from a JSON string""" + return cls.from_dict(json.loads(json_str)) - object = kwargs.get('object', "Success") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', True) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. - self = super(OpenApiModel, cls).__new__(cls) + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) - - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - - self.object = object - self.message = message - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - return self - - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) - - @convert_js_args_to_python_args - def __init__(self, message, *args, **kwargs): # noqa: E501 - """Success - a model defined in OpenAPI + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) - Args: - message (str): A message indicating that the request was successful. + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict - Keyword Args: - object (str): defaults to "Success" # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _visited_composed_classes (tuple): This stores a tuple of - classes that we have traveled through so that - if we see that class again we will not use its - discriminator again. - When traveling through a discriminator, the - composed schema that is - is traveled through is added to this set. - For example if Animal has a discriminator - petType and we pass in "Dog", and the class Dog - allOf includes Animal, we move through Animal - once using the discriminator, and pick Dog. - Then in Dog, we will make an instance of the - Animal class but this time we won't travel - through its discriminator because we passed in - _visited_composed_classes = (Animal,) - """ + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Success from a dict""" + if obj is None: + return None - object = kwargs.get('object', "Success") - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + if not isinstance(obj, dict): + return cls.model_validate(obj) - if args: - for arg in args: - if isinstance(arg, dict): - kwargs.update(arg) - else: - raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), - path_to_item=_path_to_item, - valid_classes=(self.__class__,), - ) + _obj = cls.model_validate({ + "object": obj.get("object") if obj.get("object") is not None else 'Success', + "message": obj.get("message") + }) + return _obj - self._data_store = {} - self._check_type = _check_type - self._spec_property_naming = _spec_property_naming - self._path_to_item = _path_to_item - self._configuration = _configuration - self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.object = object - self.message = message - for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: - # discard variable. - continue - setattr(self, var_name, var_value) - if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") diff --git a/unicourt/model_utils.py b/unicourt/model_utils.py deleted file mode 100755 index 545d12c..0000000 --- a/unicourt/model_utils.py +++ /dev/null @@ -1,2066 +0,0 @@ -""" - UniCourt Enterprise APIs - - # noqa: E501 - - The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -from copy import deepcopy -import inspect -import io -import os -import pprint -import re -import tempfile -import uuid - -from dateutil.parser import parse - -from unicourt.exceptions import ( - ApiKeyError, - ApiAttributeError, - ApiTypeError, - ApiValueError, -) - -none_type = type(None) -file_type = io.IOBase - - -def convert_js_args_to_python_args(fn): - from functools import wraps - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get('_spec_property_naming', False) - if spec_property_naming: - kwargs = change_keys_js_to_python( - kwargs, _self if isinstance( - _self, type) else _self.__class__) - return fn(_self, *args, **kwargs) - return wrapped_init - - -class cached_property(object): - # this caches the result of the function call for fn with no inputs - # use this as a decorator on function methods that you want converted - # into cached properties - result_key = '_results' - - def __init__(self, fn): - self._fn = fn - - def __get__(self, instance, cls=None): - if self.result_key in vars(self): - return vars(self)[self.result_key] - else: - result = self._fn() - setattr(self, self.result_key, result) - return result - - -PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) - - -def allows_single_value_input(cls): - """ - This function returns True if the input composed schema model or any - descendant model allows a value only input - This is true for cases where oneOf contains items like: - oneOf: - - float - - NumberWithValidation - - StringEnum - - ArrayModel - - null - TODO: lru_cache this - """ - if ( - issubclass(cls, ModelSimple) or - cls in PRIMITIVE_TYPES - ): - return True - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return False - return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) - return False - - -def composed_model_input_classes(cls): - """ - This function returns a list of the possible models that can be accepted as - inputs. - TODO: lru_cache this - """ - if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: - return [cls] - elif issubclass(cls, ModelNormal): - if cls.discriminator is None: - return [cls] - else: - return get_discriminated_classes(cls) - elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: - return [] - if cls.discriminator is None: - input_classes = [] - for c in cls._composed_schemas['oneOf']: - input_classes.extend(composed_model_input_classes(c)) - return input_classes - else: - return get_discriminated_classes(cls) - return [] - - -class OpenApiModel(object): - """The base class for all OpenAPIModels""" - - def set_attribute(self, name, value): - # this is only used to set properties on self - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._spec_property_naming, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value, - self._configuration - ) - # The SDK generation for datetime has value issue "datetime serialization format override" - # Refer : https://github.com/OpenAPITools/openapi-generator/issues/14503 - if type(value) == datetime or type(value) == date: - self.__dict__['_data_store'][name] = str(value) - else: - self.__dict__['_data_store'][name] = value - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other - - def __setattr__(self, attr, value): - """set the value of an attribute using dot notation: `instance.attr = val`""" - self[attr] = value - - def __getattr__(self, attr): - """get the value of an attribute using dot notation: `instance.attr`""" - return self.__getitem__(attr) - - def __copy__(self): - cls = self.__class__ - if self.get("_spec_property_naming", False): - return cls._new_from_openapi_data(**self.__dict__) - else: - return cls.__new__(cls, **self.__dict__) - - def __deepcopy__(self, memo): - cls = self.__class__ - - if self.get("_spec_property_naming", False): - new_inst = cls._new_from_openapi_data() - else: - new_inst = cls.__new__(cls, **self.__dict__) - - for k, v in self.__dict__.items(): - setattr(new_inst, k, deepcopy(v, memo)) - return new_inst - - - def __new__(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return super(OpenApiModel, cls).__new__(cls) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return super(OpenApiModel, cls).__new__(cls) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = super(OpenApiModel, cls).__new__(cls) - self_inst.__init__(*args, **kwargs) - - if kwargs.get("_spec_property_naming", False): - # when true, implies new is from deserialization - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - else: - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) - - return new_inst - - @classmethod - @convert_js_args_to_python_args - def _new_from_openapi_data(cls, *args, **kwargs): - # this function uses the discriminator to - # pick a new schema/class to instantiate because a discriminator - # propertyName value was passed in - - if len(args) == 1: - arg = args[0] - if arg is None and is_type_nullable(cls): - # The input data is the 'null' value and the type is nullable. - return None - - if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) - return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): - # Use case 1: this openapi schema (cls) does not have a discriminator - # Use case 2: we have already visited this class before and are sure that we - # want to instantiate it this time. We have visited this class deserializing - # a payload with a discriminator. During that process we traveled through - # this class but did not make an instance of it. Now we are making an - # instance of a composed class which contains cls in it, so this time make an instance of cls. - # - # Here's an example of use case 2: If Animal has a discriminator - # petType and we pass in "Dog", and the class Dog - # allOf includes Animal, we move through Animal - # once using the discriminator, and pick Dog. - # Then in the composed schema dog Dog, we will make an instance of the - # Animal class (because Dal has allOf: Animal) but this time we won't travel - # through Animal's discriminator because we passed in - # _visited_composed_classes = (Animal,) - - return cls._from_openapi_data(*args, **kwargs) - - # Get the name and value of the discriminator property. - # The discriminator name is obtained from the discriminator meta-data - # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if discr_propertyname_js in kwargs: - discr_value = kwargs[discr_propertyname_js] - elif discr_propertyname_py in kwargs: - discr_value = kwargs[discr_propertyname_py] - else: - # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) - raise ApiValueError( - "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) - ) - - # Implementation note: the last argument to get_discriminator_class - # is a list of visited classes. get_discriminator_class may recursively - # call itself and update the list of visited classes, and the initial - # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) - if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) - raise ApiValueError( - "Cannot deserialize input data due to invalid discriminator " - "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) - ) - - if new_cls in visited_composed_classes: - # if we are making an instance of a composed schema Descendent - # which allOf includes Ancestor, then Ancestor contains - # a discriminator that includes Descendent. - # So if we make an instance of Descendent, we have to make an - # instance of Ancestor to hold the allOf properties. - # This code detects that use case and makes the instance of Ancestor - # For example: - # When making an instance of Dog, _visited_composed_classes = (Dog,) - # then we make an instance of Animal to include in dog._composed_instances - # so when we are here, cls is Animal - # cls.discriminator != None - # cls not in _visited_composed_classes - # new_cls = Dog - # but we know we know that we already have Dog - # because it is in visited_composed_classes - # so make Animal here - return cls._from_openapi_data(*args, **kwargs) - - # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) - oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) - - if cls._composed_schemas.get('allOf') and oneof_anyof_child: - # Validate that we can make self because when we make the - # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) - - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) - return new_inst - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - return vals_equal - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - self.set_attribute(name, value) - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - return self.__dict__['_data_store'].get(name, default) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - if name in self: - return self.get(name) - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - if name in self.required_properties: - return name in self.__dict__ - - return name in self.__dict__['_data_store'] - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -class ModelComposed(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi and have oneOf/allOf/anyOf - - When one sets a property we use var_name_to_model_instances to store the value in - the correct class instances + run any type checking + validation code. - When one gets a property we use var_name_to_model_instances to get the value - from the correct class instances. - This allows multiple composed schemas to contain the same property with additive - constraints on the value. - - _composed_schemas (dict) stores the anyOf/allOf/oneOf classes - key (str): allOf/oneOf/anyOf - value (list): the classes in the XOf definition. - Note: none_type can be included when the openapi document version >= 3.1.0 - _composed_instances (list): stores a list of instances of the composed schemas - defined in _composed_schemas. When properties are accessed in the self instance, - they are returned from the self._data_store or the data stores in the instances - in self._composed_schemas - _var_name_to_model_instances (dict): maps between a variable name on self and - the composed instances (self included) which contain that data - key (str): property name - value (list): list of class instances, self or instances in _composed_instances - which contain the value that the key is referring to. - """ - - def __setitem__(self, name, value): - """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" - if name in self.required_properties: - self.__dict__[name] = value - return - - """ - Use cases: - 1. additional_properties_type is None (additionalProperties == False in spec) - Check for property presence in self.openapi_types - if not present then throw an error - if present set in self, set attribute - always set on composed schemas - 2. additional_properties_type exists - set attribute on self - always set on composed schemas - """ - if self.additional_properties_type is None: - """ - For an attribute to exist on a composed schema it must: - - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND - - fulfill schema_requirements in each oneOf/anyOf/allOf schemas - - schema_requirements: - For an attribute to exist on a schema it must: - - be present in properties at the schema OR - - have additionalProperties unset (defaults additionalProperties = any type) OR - - have additionalProperties set - """ - if name not in self.openapi_types: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - # attribute must be set on self and composed instances - self.set_attribute(name, value) - for model_instance in self._composed_instances: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] - return None - - __unset_attribute_value__ = object() - - def get(self, name, default=None): - """returns the value of an attribute or some default value if the attribute was not set""" - if name in self.required_properties: - return self.__dict__[name] - - # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name) - values = [] - # A composed model stores self and child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. - # Any property must exist in self and all model instances - # The value stored in all model instances must be the same - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - v = model_instance._data_store[name] - if v not in values: - values.append(v) - len_values = len(values) - if len_values == 0: - return default - elif len_values == 1: - return values[0] - elif len_values > 1: - raise ApiValueError( - "Values stored for property {0} in {1} differ when looking " - "at self and self's composed instances. All values must be " - "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e] - ) - - def __getitem__(self, name): - """get the value of an attribute using square-bracket notation: `instance[attr]`""" - value = self.get(name, self.__unset_attribute_value__) - if value is self.__unset_attribute_value__: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) - return value - - def __contains__(self, name): - """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" - - if name in self.required_properties: - return name in self.__dict__ - - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - - if model_instances: - for model_instance in model_instances: - if name in model_instance._data_store: - return True - - return False - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, self.__class__): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in self._data_store.items(): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not vals_equal: - return False - return True - - -COERCION_INDEX_BY_TYPE = { - ModelComposed: 0, - ModelNormal: 1, - ModelSimple: 2, - none_type: 3, # The type of 'None'. - list: 4, - dict: 5, - float: 6, - int: 7, - bool: 8, - datetime: 9, - date: 10, - str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - (str, date), - # A float may be serialized as an integer, e.g. '3' is a valid serialized float. - (int, float), - (list, ModelComposed), - (dict, ModelComposed), - (str, ModelComposed), - (int, ModelComposed), - (float, ModelComposed), - (list, ModelComposed), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelComposed), - # (list, ModelComposed), - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelComposed), - (list, ModelComposed), - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - (str, datetime), - (str, date), - # (int, str), - # (float, str), - (str, file_type) - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif isinstance(input_value, str): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), - raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) - raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): - raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) - ) - - -def is_json_validation_enabled(schema_keyword, configuration=None): - """Returns true if JSON schema validation is enabled for the specified - validation keyword. This can be used to skip JSON schema structural validation - as requested in the configuration. - - Args: - schema_keyword (string): the name of a JSON schema validation keyword. - configuration (Configuration): the configuration class. - """ - - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) - - -def check_validations( - validations, input_variable_path, input_values, - configuration=None): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary. - input_variable_path (tuple): the path to the input variable. - input_values (list/str/int/float/date/datetime): the values that we - are checking. - configuration (Configuration): the configuration class. - """ - - # The SDK generation for datetime has value issue "datetime serialization format override" - # Refer : https://github.com/OpenAPITools/openapi-generator/issues/14503 - if input_values is None: - return - elif type(input_values) == datetime or type(input_values) == date: - return - - current_validations = validations[input_variable_path] - if (is_json_validation_enabled('multipleOf', configuration) and - 'multiple_of' in current_validations and - isinstance(input_values, (int, float)) and - not (float(input_values) / current_validations['multiple_of']).is_integer()): - # Note 'multipleOf' will be as good as the floating point arithmetic. - raise ApiValueError( - "Invalid value for `%s`, value must be a multiple of " - "`%s`" % ( - input_variable_path[0], - current_validations['multiple_of'] - ) - ) - - if (is_json_validation_enabled('maxLength', configuration) and - 'max_length' in current_validations and - len(input_values) > current_validations['max_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) - ) - - if (is_json_validation_enabled('minLength', configuration) and - 'min_length' in current_validations and - len(input_values) < current_validations['min_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) - ) - - if (is_json_validation_enabled('maxItems', configuration) and - 'max_items' in current_validations and - len(input_values) > current_validations['max_items']): - raise ApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) - ) - - if (is_json_validation_enabled('minItems', configuration) and - 'min_items' in current_validations and - len(input_values) < current_validations['min_items']): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) - ) - - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if (is_json_validation_enabled('exclusiveMaximum', configuration) and - 'exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('maximum', configuration) and - 'inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('exclusiveMinimum', configuration) and - 'exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if (is_json_validation_enabled('minimum', configuration) and - 'inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) - ) - flags = current_validations.get('regex', {}).get('flags', 0) - if (is_json_validation_enabled('pattern', configuration) and - 'regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): - err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( - input_variable_path[0], - current_validations['regex']['pattern'] - ) - if flags != 0: - # Don't print the regex flags if the flags are not - # specified in the OAS document. - err_msg = r"%s with flags=`%s`" % (err_msg, flags) - raise ApiValueError(err_msg) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with class information inside it. - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with class information inside it. - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelComposed)): - return COERCION_INDEX_BY_TYPE[ModelComposed] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): - return COERCION_INDEX_BY_TYPE[ModelSimple] - elif class_or_instance in COERCION_INDEX_BY_TYPE: - return COERCION_INDEX_BY_TYPE[class_or_instance] - raise ApiValueError("Unsupported type: %s" % class_or_instance) - - sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) - ) - return sorted_types - - -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, - must_convert=True): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - current_item (any): the current item (input data) to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelComposed): - required_type_class_simplified = ModelComposed - elif issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: - results_classes.append(required_type_class) - elif class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - return results_classes - - -def get_discriminated_classes(cls): - """ - Returns all the classes that a discriminator converts to - TODO: lru_cache this - """ - possible_classes = [] - key = list(cls.discriminator.keys())[0] - if is_type_nullable(cls): - possible_classes.append(cls) - for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: - possible_classes.extend(get_discriminated_classes(discr_cls)) - else: - possible_classes.append(discr_cls) - return possible_classes - - -def get_possible_classes(cls, from_server_context): - # TODO: lru_cache this - possible_classes = [cls] - if from_server_context: - return possible_classes - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - possible_classes = [] - possible_classes.extend(get_discriminated_classes(cls)) - elif issubclass(cls, ModelComposed): - possible_classes.extend(composed_model_input_classes(cls)) - return possible_classes - - -def get_required_type_classes(required_types_mixed, spec_property_naming): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - spec_property_naming (bool): if True these values came from the - server, and we use the data types in our endpoints. - If False, we are client side and we need to include - oneOf and discriminator classes inside the data types in our endpoints - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (dict): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class. - If the input_dict contains a key which does not declared in the model_class, - the key is added to the output dict as is. The assumption is the model_class - may have undeclared properties (additionalProperties attribute in the OAS - document). - """ - - if getattr(model_class, 'attribute_map', None) is None: - return input_dict - output_dict = {} - reversed_attr_map = {value: key for key, value in - model_class.attribute_map.items()} - for javascript_key, value in input_dict.items(): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type - ) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool, date, datetime - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') - return converted_value - except (OverflowError, ValueError) as ex: - # parse can raise OverflowError - raise ApiValueError( - "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), klass.__name__ - ), - path_to_item=path_to_item - ) from ex - - -def get_discriminator_class(model_class, - discr_name, - discr_value, cls_visited): - """Returns the child class specified by the discriminator. - - Args: - model_class (OpenApiModel): the model class. - discr_name (string): the name of the discriminator property. - discr_value (any): the discriminator value. - cls_visited (list): list of model classes that have been visited. - Used to determine the discriminator class without - visiting circular references indefinitely. - - Returns: - used_model_class (class/None): the chosen child class that will be used - to deserialize the data, for example dog.Dog. - If a class is not found, None is returned. - """ - - if model_class in cls_visited: - # The class has already been visited and no suitable class was found. - return None - cls_visited.append(model_class) - used_model_class = None - if discr_name in model_class.discriminator: - class_name_to_discr_class = model_class.discriminator[discr_name] - used_model_class = class_name_to_discr_class.get(discr_value) - if used_model_class is None: - # We didn't find a discriminated class in class_name_to_discr_class. - # So look in the ancestor or descendant discriminators - # The discriminator mapping may exist in a descendant (anyOf, oneOf) - # or ancestor (allOf). - # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat - # hierarchy, the discriminator mappings may be defined at any level - # in the hierarchy. - # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig - # if we try to make BasquePig from mammal, we need to travel through - # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ - model_class._composed_schemas.get('anyOf', ()) - ancestor_classes = model_class._composed_schemas.get('allOf', ()) - possible_classes = descendant_classes + ancestor_classes - for cls in possible_classes: - # Check if the schema has inherited discriminators. - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited) - if used_model_class is not None: - return used_model_class - return used_model_class - - -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, spec_property_naming): - """Deserializes model_data to model instance. - - Args: - model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - - Returns: - model instance - - Raise: - ApiTypeError - ApiValueError - ApiKeyError - """ - - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming) - - if issubclass(model_class, ModelSimple): - return model_class._new_from_openapi_data(model_data, **kw_args) - elif isinstance(model_data, list): - return model_class._new_from_openapi_data(*model_data, **kw_args) - if isinstance(model_data, dict): - kw_args.update(model_data) - return model_class._new_from_openapi_data(**kw_args) - elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class._new_from_openapi_data(model_data, **kw_args) - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition, - flags=re.I) - if filename is not None: - filename = filename.group(1) - else: - filename = "default_" + str(uuid.uuid4()) - - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, spec_property_naming, key_type=False, - must_convert=False, check_type=True): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelComposed/ModelNormal/ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - ApiTypeError - ApiValueError - ApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming) - if not valid_classes_coercible or key_type: - # we do not handle keytype errors, json will take care - # of this for us - if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, spec_property_naming) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) - except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def is_type_nullable(input_type): - """ - Returns true if None is an allowed value for the specified input_type. - - A type is nullable if at least one of the following conditions is true: - 1. The OAS 'nullable' attribute has been specified, - 1. The type is the 'null' type, - 1. The type is a anyOf/oneOf composed schema, and a child schema is - the 'null' type. - Args: - input_type (type): the class of the input_value that we are - checking - Returns: - bool - """ - if input_type is none_type: - return True - if issubclass(input_type, OpenApiModel) and input_type._nullable: - return True - if issubclass(input_type, ModelComposed): - # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get('oneOf', ()): - if is_type_nullable(t): - return True - for t in input_type._composed_schemas.get('anyOf', ()): - if is_type_nullable(t): - return True - return False - - -def is_valid_type(input_class_simple, valid_classes): - """ - Args: - input_class_simple (class): the class of the input_value that we are - checking - valid_classes (tuple): the valid classes that the current item - should be - Returns: - bool - """ - if issubclass(input_class_simple, OpenApiModel) and \ - valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): - return True - valid_type = input_class_simple in valid_classes - if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or - input_class_simple is none_type): - for valid_class in valid_classes: - if input_class_simple is none_type and is_type_nullable(valid_class): - # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. - return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): - continue - discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = ( - valid_class.discriminator[discr_propertyname_py].values() - ) - valid_type = is_valid_type(input_class_simple, discriminator_classes) - if valid_type: - return True - return valid_type - - -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - spec_property_naming, _check_type, configuration=None): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - spec_property_naming (bool): True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - ApiTypeError - """ - results = get_required_type_classes(required_types_mixed, spec_property_naming) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = is_valid_type(input_class_simple, valid_classes) - if not valid_type: - if (configuration - or (input_class_simple == dict - and dict not in valid_classes)): - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=True, - check_type=_check_type - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - spec_property_naming, - key_type=False, - must_convert=False, - check_type=_check_type - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in input_value.items(): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - spec_property_naming, - _check_type, - configuration=configuration - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - - def extract_item(item): return ( - item[0], model_to_dict( - item[1], serialize=serialize)) if hasattr( - item[1], '_data_store') else item - - model_instances = [model_instance] - if model_instance._composed_schemas: - model_instances.extend(model_instance._composed_instances) - seen_json_attribute_names = set() - used_fallback_python_attribute_names = set() - py_to_json_map = {} - for model_instance in model_instances: - for attr, value in model_instance._data_store.items(): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - try: - attr = model_instance.attribute_map[attr] - py_to_json_map.update(model_instance.attribute_map) - seen_json_attribute_names.add(attr) - except KeyError: - used_fallback_python_attribute_names.add(attr) - if isinstance(value, list): - if not value: - # empty list or None - result[attr] = value - else: - res = [] - for v in value: - if isinstance(v, PRIMITIVE_TYPES) or v is None: - res.append(v) - elif isinstance(v, ModelSimple): - res.append(v.value) - elif isinstance(v, dict): - res.append(dict(map( - extract_item, - v.items() - ))) - else: - res.append(model_to_dict(v, serialize=serialize)) - result[attr] = res - elif isinstance(value, dict): - result[attr] = dict(map( - extract_item, - value.items() - )) - elif isinstance(value, ModelSimple): - result[attr] = value.value - elif hasattr(value, '_data_store'): - result[attr] = model_to_dict(value, serialize=serialize) - else: - result[attr] = value - if serialize: - for python_key in used_fallback_python_attribute_names: - json_key = py_to_json_map.get(python_key) - if json_key is None: - continue - if python_key == json_key: - continue - json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names - if json_key_assigned_no_need_for_python_key: - del result[python_key] - - return result - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = 'value' - if key_type: - key_or_value = 'key' - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - "Invalid type for variable '{0}'. Required {1} type {2} and " - "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - """ - all_classes = list(input_classes) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - -def get_allof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - used to make instances - constant_args (dict): - metadata arguments: - _check_type - _path_to_item - _spec_property_naming - _configuration - _visited_composed_classes - - Returns - composed_instances (list) - """ - composed_instances = [] - for allof_class in self._composed_schemas['allOf']: - - try: - if constant_args.get('_spec_property_naming'): - allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) - else: - allof_instance = allof_class(**model_args, **constant_args) - composed_instances.append(allof_instance) - except Exception as ex: - raise ApiValueError( - "Invalid inputs given to generate an instance of '%s'. The " - "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % ( - allof_class.__name__, - allof_class.__name__, - self.__class__.__name__, - str(ex) - ) - ) from ex - return composed_instances - - -def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): - """ - Find the oneOf schema that matches the input data (e.g. payload). - If exactly one schema matches the input data, an instance of that schema - is returned. - If zero or more than one schema match the input data, an exception is raised. - In OAS 3.x, the payload MUST, by validation, match exactly one of the - schemas described by oneOf. - - Args: - cls: the class we are handling - model_kwargs (dict): var_name to var_value - The input data, e.g. the payload that must match a oneOf schema - in the OpenAPI document. - constant_kwargs (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Kwargs: - model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): - the value to assign to a primitive class or ModelSimple class - Notes: - - this is only passed in when oneOf includes types which are not object - - None is used to suppress handling of model_arg, nullable models are handled in __new__ - - Returns - oneof_instance (instance) - """ - if len(cls._composed_schemas['oneOf']) == 0: - return None - - oneof_instances = [] - # Iterate over each oneOf schema and determine if the input data - # matches the oneOf schemas. - for oneof_class in cls._composed_schemas['oneOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if oneof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - single_value_input = allows_single_value_input(oneof_class) - - try: - if not single_value_input: - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data( - **model_kwargs, **constant_kwargs) - else: - oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) - else: - if issubclass(oneof_class, ModelSimple): - if constant_kwargs.get('_spec_property_naming'): - oneof_instance = oneof_class._from_openapi_data( - model_arg, **constant_kwargs) - else: - oneof_instance = oneof_class(model_arg, **constant_kwargs) - elif oneof_class in PRIMITIVE_TYPES: - oneof_instance = validate_and_convert_types( - model_arg, - (oneof_class,), - constant_kwargs['_path_to_item'], - constant_kwargs['_spec_property_naming'], - constant_kwargs['_check_type'], - configuration=constant_kwargs['_configuration'] - ) - oneof_instances.append(oneof_instance) - except Exception: - pass - if len(oneof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % - cls.__name__ - ) - elif len(oneof_instances) > 1: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % - cls.__name__ - ) - return oneof_instances[0] - - -def get_anyof_instances(self, model_args, constant_args): - """ - Args: - self: the class we are handling - model_args (dict): var_name to var_value - The input data, e.g. the payload that must match at least one - anyOf child schema in the OpenAPI document. - constant_args (dict): var_name to var_value - args that every model requires, including configuration, server - and path to item. - - Returns - anyof_instances (list) - """ - anyof_instances = [] - if len(self._composed_schemas['anyOf']) == 0: - return anyof_instances - - for anyof_class in self._composed_schemas['anyOf']: - # The composed oneOf schema allows the 'null' type and the input data - # is the null value. This is a OAS >= 3.1 feature. - if anyof_class is none_type: - # skip none_types because we are deserializing dict data. - # none_type deserialization is handled in the __new__ method - continue - - try: - if constant_args.get('_spec_property_naming'): - anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) - else: - anyof_instance = anyof_class(**model_args, **constant_args) - anyof_instances.append(anyof_instance) - except Exception: - pass - if len(anyof_instances) == 0: - raise ApiValueError( - "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % - self.__class__.__name__ - ) - return anyof_instances - - -def get_discarded_args(self, composed_instances, model_args): - """ - Gathers the args that were discarded by configuration.discard_unknown_keys - """ - model_arg_keys = model_args.keys() - discarded_args = set() - # arguments passed to self were already converted to python names - # before __init__ was called - for instance in composed_instances: - if instance.__class__ in self._composed_schemas['allOf']: - try: - keys = instance.to_dict().keys() - discarded_keys = model_args - keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - else: - try: - all_keys = set(model_to_dict(instance, serialize=False).keys()) - js_keys = model_to_dict(instance, serialize=True).keys() - all_keys.update(js_keys) - discarded_keys = model_arg_keys - all_keys - discarded_args.update(discarded_keys) - except Exception: - # allOf integer schema will throw exception - pass - return discarded_args - - -def validate_get_composed_info(constant_args, model_args, self): - """ - For composed schemas, generate schema instances for - all schemas in the oneOf/anyOf/allOf definition. If additional - properties are allowed, also assign those properties on - all matched schemas that contain additionalProperties. - Openapi schemas are python classes. - - Exceptions are raised if: - - 0 or > 1 oneOf schema matches the model_args input data - - no anyOf schema matches the model_args input data - - any of the allOf schemas do not match the model_args input data - - Args: - constant_args (dict): these are the args that every model requires - model_args (dict): these are the required and optional spec args that - were passed in to make this model - self (class): the class that we are instantiating - This class contains self._composed_schemas - - Returns: - composed_info (list): length three - composed_instances (list): the composed instances which are not - self - var_name_to_model_instances (dict): a dict going from var_name - to the model_instance which holds that var_name - the model_instance may be self or an instance of one of the - classes in self.composed_instances() - additional_properties_model_instances (list): a list of the - model instances which have the property - additional_properties_type. This list can include self - """ - # create composed_instances - composed_instances = [] - allof_instances = get_allof_instances(self, model_args, constant_args) - composed_instances.extend(allof_instances) - oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) - if oneof_instance is not None: - composed_instances.append(oneof_instance) - anyof_instances = get_anyof_instances(self, model_args, constant_args) - composed_instances.extend(anyof_instances) - """ - set additional_properties_model_instances - additional properties must be evaluated at the schema level - so self's additional properties are most important - If self is a composed schema with: - - no properties defined in self - - additionalProperties: False - Then for object payloads every property is an additional property - and they are not allowed, so only empty dict is allowed - - Properties must be set on all matching schemas - so when a property is assigned toa composed instance, it must be set on all - composed instances regardless of additionalProperties presence - keeping it to prevent breaking changes in v5.0.1 - TODO remove cls._additional_properties_model_instances in 6.0.0 - """ - additional_properties_model_instances = [] - if self.additional_properties_type is not None: - additional_properties_model_instances = [self] - - """ - no need to set properties on self in here, they will be set in __init__ - By here all composed schema oneOf/anyOf/allOf instances have their properties set using - model_args - """ - discarded_args = get_discarded_args(self, composed_instances, model_args) - - # map variable names to composed_instances - var_name_to_model_instances = {} - for prop_name in model_args: - if prop_name not in discarded_args: - var_name_to_model_instances[prop_name] = [self] + list( - filter( - lambda x: prop_name in x.openapi_types, composed_instances)) - - return [ - composed_instances, - var_name_to_model_instances, - additional_properties_model_instances, - discarded_args - ] diff --git a/unicourt/py.typed b/unicourt/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/unicourt/rest.py b/unicourt/rest.py index cd1febb..92868a5 100644 --- a/unicourt/rest.py +++ b/unicourt/rest.py @@ -1,54 +1,68 @@ +# coding: utf-8 + """ UniCourt Enterprise APIs - # noqa: E501 + The version of the OpenAPI document: - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import io import json -import logging import re import ssl -from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment + import urllib3 -import ipaddress -from unicourt.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError +from unicourt.exceptions import SdkException, ApiValueError +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse -logger = logging.getLogger(__name__) + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): - def __init__(self, resp): - self.urllib3_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) + return self.response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -57,71 +71,79 @@ def __init__(self, configuration, pools_size=4, maxsize=None): else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options + pool_args['socket_options'] = configuration.socket_options - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager - if configuration.proxy and not should_bypass_proxies( - configuration.host, no_proxy=configuration.no_proxy or ''): - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -133,61 +155,83 @@ def request(self, method, url, query_params=None, headers=None, timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + connect=_request_timeout[0], + read=_request_timeout[1] + ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', - headers['Content-Type'], re.IGNORECASE)): + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + preload_content=False + ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body r = self.pool_manager.request( - method, url, + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers) else: @@ -195,158 +239,19 @@ def request(self, method, url, query_params=None, headers=None, msg = """Cannot prepare a request message for provided arguments. Please check that your arguments match declared content type.""" - raise ApiException(status=0, reason=msg) + raise SdkException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - -# end of class RESTClientObject - - -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - + msg = "\n".join([type(e).__name__, str(e)]) + raise SdkException(status=0, reason=msg) -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None, '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ', ''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy}) + return RESTResponse(r) diff --git a/unicourt/sdk/AttorneyAnalytics.py b/unicourt/sdk/AttorneyAnalytics.py index 4985ead..62a28e3 100644 --- a/unicourt/sdk/AttorneyAnalytics.py +++ b/unicourt/sdk/AttorneyAnalytics.py @@ -1,127 +1,949 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated +from unicourt.model.associated_norm_judge_response import AssociatedNormJudgeResponse +from unicourt.model.associated_norm_law_firm_response import AssociatedNormLawFirmResponse +from unicourt.model.associated_norm_party_response import AssociatedNormPartyResponse +from unicourt.model.norm_attorney import NormAttorney +from unicourt.model.norm_attorney_search_response import NormAttorneySearchResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.attorney_analytics_api import AttorneyAnalyticsApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class AttorneyAnalytics: @staticmethod def get_norm_attorney_by_id( - norm_attorney_id, - **kwargs - ): - - """Norm Attorney Details. - - - This endpoint retrieves information on the attorney in our normalized attorney database which matches the normAttorneyId specified in the request. + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm ID of Attorney. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[NormAttorney]: + + """Norm Attorney Details. + + This endpoint retrieves information on the attorney in our normalized attorney database which matches the normAttorneyId specified in the request. + + :param norm_attorney_id: Norm ID of Attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = AttorneyAnalyticsApi(api_client).get_norm_attorney_by_id_with_http_info(norm_attorney_id = norm_attorney_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_attorney_by_id_with_http_info( + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm ID of Attorney. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormAttorney]: + + """Norm Attorney Details. + + This endpoint retrieves information on the attorney in our normalized attorney database which matches the normAttorneyId specified in the request. + + :param norm_attorney_id: Norm ID of Attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return AttorneyAnalyticsApi(api_client).get_norm_attorney_by_id_with_http_info(norm_attorney_id = norm_attorney_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_attorney_by_id_without_preload_content( + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm ID of Attorney. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Norm Attorney Details. + + This endpoint retrieves information on the attorney in our normalized attorney database which matches the normAttorneyId specified in the request. + + :param norm_attorney_id: Norm ID of Attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return AttorneyAnalyticsApi(api_client).get_norm_attorney_by_id( - norm_attorney_id, - **kwargs - ) + response = AttorneyAnalyticsApi(api_client).get_norm_attorney_by_id_without_preload_content_with_http_info(norm_attorney_id = norm_attorney_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_norm_judges_associated_with_norm_attorney( - norm_attorney_id, - **kwargs - ): - - """Judges faced by the Attorney. - - - This endpoint returns information on all judges which have appeared in cases with the attorney specified by the normAttorneyId. The returned judges are ordered in descending order of number of cases shared with the relevant attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm ID of Attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AssociatedNormJudgeResponse]: + + """Judges faced by the Attorney. + + This endpoint returns information on all judges which have appeared in cases with the attorney specified by the normAttorneyId. The returned judges are ordered in descending order of number of cases shared with the relevant attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: Norm ID of Attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = AttorneyAnalyticsApi(api_client).get_norm_judges_associated_with_norm_attorney_with_http_info(norm_attorney_id = norm_attorney_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_judges_associated_with_norm_attorney_with_http_info( + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm ID of Attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormJudgeResponse]: + + """Judges faced by the Attorney. + + This endpoint returns information on all judges which have appeared in cases with the attorney specified by the normAttorneyId. The returned judges are ordered in descending order of number of cases shared with the relevant attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: Norm ID of Attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return AttorneyAnalyticsApi(api_client).get_norm_judges_associated_with_norm_attorney_with_http_info(norm_attorney_id = norm_attorney_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_judges_associated_with_norm_attorney_without_preload_content( + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm ID of Attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Judges faced by the Attorney. + + This endpoint returns information on all judges which have appeared in cases with the attorney specified by the normAttorneyId. The returned judges are ordered in descending order of number of cases shared with the relevant attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: Norm ID of Attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return AttorneyAnalyticsApi(api_client).get_norm_judges_associated_with_norm_attorney( - norm_attorney_id, - **kwargs - ) + response = AttorneyAnalyticsApi(api_client).get_norm_judges_associated_with_norm_attorney_without_preload_content_with_http_info(norm_attorney_id = norm_attorney_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_norm_law_firms_associated_with_norm_attorney( - norm_attorney_id, - **kwargs - ): - - """Law Firms the attorney has worked for. - - - Retrieve law firms with which the specified attorney is known to have been associated. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all LawFirms associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired firms. Keyword expressions should be constructed according to the guidelines shown above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AssociatedNormLawFirmResponse]: + + """Law Firms the attorney has worked for. + + Retrieve law firms with which the specified attorney is known to have been associated. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all LawFirms associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired firms. Keyword expressions should be constructed according to the guidelines shown above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = AttorneyAnalyticsApi(api_client).get_norm_law_firms_associated_with_norm_attorney_with_http_info(norm_attorney_id = norm_attorney_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_law_firms_associated_with_norm_attorney_with_http_info( + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired firms. Keyword expressions should be constructed according to the guidelines shown above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormLawFirmResponse]: + + """Law Firms the attorney has worked for. + + Retrieve law firms with which the specified attorney is known to have been associated. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all LawFirms associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired firms. Keyword expressions should be constructed according to the guidelines shown above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return AttorneyAnalyticsApi(api_client).get_norm_law_firms_associated_with_norm_attorney_with_http_info(norm_attorney_id = norm_attorney_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_law_firms_associated_with_norm_attorney_without_preload_content( + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired firms. Keyword expressions should be constructed according to the guidelines shown above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Law Firms the attorney has worked for. + + Retrieve law firms with which the specified attorney is known to have been associated. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all LawFirms associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired firms. Keyword expressions should be constructed according to the guidelines shown above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return AttorneyAnalyticsApi(api_client).get_norm_law_firms_associated_with_norm_attorney( - norm_attorney_id, - **kwargs - ) + response = AttorneyAnalyticsApi(api_client).get_norm_law_firms_associated_with_norm_attorney_without_preload_content_with_http_info(norm_attorney_id = norm_attorney_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_norm_parties_associated_with_norm_attorney( - norm_attorney_id, - **kwargs - ): - - """Parties Represented By the Attorney. - - - Retrieve the parties for which an attorney is known to have represented.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object.. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keyword expressions should be constructed according to the guidelines shown above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AssociatedNormPartyResponse]: + + """Parties Represented By the Attorney. + + Retrieve the parties for which an attorney is known to have represented.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object.. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired parties. Keyword expressions should be constructed according to the guidelines shown above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = AttorneyAnalyticsApi(api_client).get_norm_parties_associated_with_norm_attorney_with_http_info(norm_attorney_id = norm_attorney_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_parties_associated_with_norm_attorney_with_http_info( + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keyword expressions should be constructed according to the guidelines shown above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormPartyResponse]: + + """Parties Represented By the Attorney. + + Retrieve the parties for which an attorney is known to have represented.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object.. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired parties. Keyword expressions should be constructed according to the guidelines shown above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return AttorneyAnalyticsApi(api_client).get_norm_parties_associated_with_norm_attorney_with_http_info(norm_attorney_id = norm_attorney_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_parties_associated_with_norm_attorney_without_preload_content( + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keyword expressions should be constructed according to the guidelines shown above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Parties Represented By the Attorney. + + Retrieve the parties for which an attorney is known to have represented.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\", \"CORTKQiA4LJuv54tEj\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object.. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with attorney with norm id NATYfwmXwRHS279WPY of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_attorney_id: The normAttorneyId value of the desired attorney. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired parties. Keyword expressions should be constructed according to the guidelines shown above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return AttorneyAnalyticsApi(api_client).get_norm_parties_associated_with_norm_attorney( - norm_attorney_id, - **kwargs - ) + response = AttorneyAnalyticsApi(api_client).get_norm_parties_associated_with_norm_attorney_without_preload_content_with_http_info(norm_attorney_id = norm_attorney_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def search_normalized_attorneys( - **kwargs - ): - - """Attorney search. - - - ### This endpoint retrieves information, including the normAttorneyId, on all attorneys in our normalized attorney database which match the request parameters. All query parameters supported by this API can be found in the schema section below. + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[NormAttorneySearchResponse]: + + """Attorney search. + + ### This endpoint retrieves information, including the normAttorneyId, on all attorneys in our normalized attorney database which match the request parameters. All query parameters supported by this API can be found in the schema section below. + + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = AttorneyAnalyticsApi(api_client).search_normalized_attorneys_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def search_normalized_attorneys_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormAttorneySearchResponse]: + + """Attorney search. + + ### This endpoint retrieves information, including the normAttorneyId, on all attorneys in our normalized attorney database which match the request parameters. All query parameters supported by this API can be found in the schema section below. + + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return AttorneyAnalyticsApi(api_client).search_normalized_attorneys_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def search_normalized_attorneys_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Attorney search. + + ### This endpoint retrieves information, including the normAttorneyId, on all attorneys in our normalized attorney database which match the request parameters. All query parameters supported by this API can be found in the schema section below. + + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return AttorneyAnalyticsApi(api_client).search_normalized_attorneys( - **kwargs - ) + response = AttorneyAnalyticsApi(api_client).search_normalized_attorneys_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def search_normalized_attorneys_by_id( - norm_attorney_search_id, - **kwargs - ): - - """Norm attorney search results for a given normAttorneySearchId. - - - ### All query parameters supported for this API can be found in below schema section. Schema --> NormAttorneySearchQueryObject + norm_attorney_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm Attorney Search information for the given normAttorneySearchId.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[NormAttorneySearchResponse]: + + """Norm attorney search results for a given normAttorneySearchId. + + ### All query parameters supported for this API can be found in below schema section. Schema --> NormAttorneySearchQueryObject + + :param norm_attorney_search_id: Norm Attorney Search information for the given normAttorneySearchId. (required) + :type norm_attorney_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = AttorneyAnalyticsApi(api_client).search_normalized_attorneys_by_id_with_http_info(norm_attorney_search_id = norm_attorney_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def search_normalized_attorneys_by_id_with_http_info( + norm_attorney_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm Attorney Search information for the given normAttorneySearchId.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormAttorneySearchResponse]: + + """Norm attorney search results for a given normAttorneySearchId. + + ### All query parameters supported for this API can be found in below schema section. Schema --> NormAttorneySearchQueryObject + + :param norm_attorney_search_id: Norm Attorney Search information for the given normAttorneySearchId. (required) + :type norm_attorney_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return AttorneyAnalyticsApi(api_client).search_normalized_attorneys_by_id_with_http_info(norm_attorney_search_id = norm_attorney_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def search_normalized_attorneys_by_id_without_preload_content( + norm_attorney_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Norm Attorney Search information for the given normAttorneySearchId.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Norm attorney search results for a given normAttorneySearchId. + + ### All query parameters supported for this API can be found in below schema section. Schema --> NormAttorneySearchQueryObject + + :param norm_attorney_search_id: Norm Attorney Search information for the given normAttorneySearchId. (required) + :type norm_attorney_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return AttorneyAnalyticsApi(api_client).search_normalized_attorneys_by_id( - norm_attorney_search_id, - **kwargs - ) + response = AttorneyAnalyticsApi(api_client).search_normalized_attorneys_by_id_without_preload_content_with_http_info(norm_attorney_search_id = norm_attorney_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/Authentication.py b/unicourt/sdk/Authentication.py index 06adc2a..06b42b4 100644 --- a/unicourt/sdk/Authentication.py +++ b/unicourt/sdk/Authentication.py @@ -1,11 +1,25 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated + import unicourt -from unicourt.api.authentication_api import AuthenticationApi +from unicourt.model.access_token_id_list_response import AccessTokenIdListResponse from unicourt.model.access_token_request import AccessTokenRequest +from unicourt.model.access_token_response import AccessTokenResponse from unicourt.model.invalidate_access_token_request import InvalidateAccessTokenRequest +from unicourt.model.success import Success +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType +from unicourt.api.authentication_api import AuthenticationApi +from unicourt.sdk_response import SdkResponse from unicourt import utils - -class Authentication(object): +class Authentication: def update_api_client_after_login(): """ @@ -17,11 +31,21 @@ def update_api_client_after_login(): access_token=unicourt.ACCESS_TOKEN) unicourt.api_client = unicourt.ApiClient(unicourt.configuration) - def generate_new_token(client_id=None, client_secret=None): - """Generate new token to access API. - Generate new access token, UniCourt provides clientId and client Secret. - Each time you will get new Access token. At a time you can have max 10 access tokens. - There will not be any expiry for access token. If you request for more than 10 tokens you will get error message. + @staticmethod + def generate_new_token( + client_id: Annotated[str, Field(description="Your Client ID obtainable by logging into your UniCourt account.")] = None, + client_secret: Annotated[str, Field(description="Your Client Secret ID obtainable by logging into your UniCourt account.")]= None + ) -> SdkResponse[AccessTokenResponse]: + + """Generate new token to access API. + + This endpoint allows you to generate a new access token, which is a required field for all UniCourt API endpoints except for the Authentication API. To generate a new token, you must provide your Client ID and Client Secret ID which you can find by logging into your UniCourt account. At any time, you can have a maximum of 10 active access tokens. The tokens never expire and, if you make a request which would otherwise lead to you having more than 10 active tokens, you will receive an error message. + + :param client_id: Your Client ID obtainable by logging into your UniCourt account. + :type client_id: str + :param client_secret: Your Client Secret ID obtainable by logging into your UniCourt account. + :type client_secret: str + :return: Returns the result object. """ with utils.api_client() as api_client: unicourt.CLIENT_ID = client_id or unicourt.CLIENT_ID @@ -30,46 +54,87 @@ def generate_new_token(client_id=None, client_secret=None): client_id=unicourt.CLIENT_ID, client_secret=unicourt.CLIENT_SECRET, ) - response, status = AuthenticationApi(api_client).generate_new_token( + response = AuthenticationApi(api_client).generate_new_token_with_http_info( access_token_request=payload) - unicourt.ACCESS_TOKEN = response.access_token - unicourt.TOKEN_ID = response.token_id + unicourt.ACCESS_TOKEN = response.data.access_token + unicourt.TOKEN_ID = response.data.token_id Authentication.update_api_client_after_login() - return response, status + return (response.data, response.status_code) - def invalidate_token(client_id=None, client_secret=None, token_id=None): - """API to invalidate all access tokens. - Logout API to invalidate all access tokens. + @staticmethod + def invalidate_all_tokens( + client_id: Annotated[str, Field(description="Your Client ID obtainable by logging into your UniCourt account.")] = None, + client_secret: Annotated[str, Field(description="Your Client Secret ID obtainable by logging into your UniCourt account.")]= None + ) -> SdkResponse[Success]: + + """API to invalidate all access tokens. + + An endpoint which allows you to invalidate all existing access tokens associated with your UniCourt account. + + :param client_id: Your Client ID obtainable by logging into your UniCourt account. + :type client_id: str + :param client_secret: Your Client Secret ID obtainable by logging into your UniCourt account. + :type client_secret: str + :return: Returns the result object. """ - invalidate_access_token_request = InvalidateAccessTokenRequest( + access_token_request = AccessTokenRequest( client_id=client_id or unicourt.CLIENT_ID, client_secret=client_secret or unicourt.CLIENT_SECRET, - token_id=token_id or unicourt.TOKEN_ID ) + with utils.api_client() as api_client: - return AuthenticationApi(api_client).invalidate_token( - invalidate_access_token_request=invalidate_access_token_request) + response = AuthenticationApi(api_client).invalidate_all_tokens_with_http_info(access_token_request = access_token_request) + return (response.data, response.status_code) - def invalidate_all_tokens(client_id=None, client_secret=None): - """API to invalidate the access token. # noqa: E501 - API to invalidate the access token + @staticmethod + def invalidate_token( + client_id: Annotated[str, Field(description="Your Client ID obtainable by logging into your UniCourt account.")] = None, + client_secret: Annotated[str, Field(description="Your Client Secret ID obtainable by logging into your UniCourt account.")]= None, + token_id: Annotated[str, Field(description="The Token ID of token being invalidated.")]= None + ) -> SdkResponse[Success]: + + """API to invalidate the access token. + + An endpoint which allows you to invalidate a given access token. + + :param client_id: Your Client ID obtainable by logging into your UniCourt account. + :type client_id: str + :param client_secret: Your Client Secret ID obtainable by logging into your UniCourt account. + :type client_secret: str + :param token_id: The Token ID of token being invalidated. + :type token_id: str + :return: Returns the result object. """ - access_token_request = AccessTokenRequest( - client_id=unicourt.CLIENT_ID, - client_secret=unicourt.CLIENT_SECRET, + invalidate_access_token_request = InvalidateAccessTokenRequest( + client_id=client_id or unicourt.CLIENT_ID, + client_secret=client_secret or unicourt.CLIENT_SECRET, + token_id=token_id or unicourt.TOKEN_ID ) with utils.api_client() as api_client: - return AuthenticationApi(api_client).invalidate_all_tokens( - access_token_request=access_token_request) + response = AuthenticationApi(api_client).invalidate_token_with_http_info(invalidate_access_token_request = invalidate_access_token_request) + return (response.data, response.status_code) + + @staticmethod + def list_all_token_ids( + client_id: Annotated[str, Field(description="Your Client ID obtainable by logging into your UniCourt account.")] = None, + client_secret: Annotated[str, Field(description="Your Client Secret ID obtainable by logging into your UniCourt account.")]= None + ) -> SdkResponse[AccessTokenIdListResponse]: + + """API to list all the access tokens Id. + + An endpoint which allows you to view all active access tokens associated with your Client ID and Client Secret ID. - def list_all_token_ids(client_id=None, client_secret=None): - """API to list all the access tokens Id. - API to list all the access tokens Id. + :param client_id: Your Client ID obtainable by logging into your UniCourt account. + :type client_id: str + :param client_secret: Your Client Secret ID obtainable by logging into your UniCourt account. + :type client_secret: str + :return: Returns the result object. """ access_token_request = AccessTokenRequest( - client_id=unicourt.CLIENT_ID, - client_secret=unicourt.CLIENT_SECRET, + client_id=client_id or unicourt.CLIENT_ID, + client_secret=client_secret or unicourt.CLIENT_SECRET, ) + with utils.api_client() as api_client: - return AuthenticationApi(api_client).list_all_token_ids( - access_token_request=access_token_request) + response = AuthenticationApi(api_client).list_all_token_ids_with_http_info(access_token_request = access_token_request) + return (response.data, response.status_code) diff --git a/unicourt/sdk/Callback.py b/unicourt/sdk/Callback.py index e196e17..6420f3a 100644 --- a/unicourt/sdk/Callback.py +++ b/unicourt/sdk/Callback.py @@ -1,22 +1,168 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from datetime import datetime +from pydantic import Field, field_validator +from typing import Optional +from typing_extensions import Annotated +from unicourt.model.callback_list_response import CallbackListResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.callback_api import CallbackApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class Callback: @staticmethod def get_callbacks( - **kwargs - ): + date: Annotated[Optional[datetime], Field(description="Date for which fetch the callback type list. By default, the date will be set to current date.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of the callbacks. Default status will fetch all callbacks.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CallbackListResponse]: - """Get list of callback types with count for a requested Date. + """Get list of callback types with count for a requested Date. + Get list of callback types with count for a requested Date. - Get list of callback types with count for a requested Date. + :param date: Date for which fetch the callback type list. By default, the date will be set to current date. + :type date: datetime + :param status: Status of the callbacks. Default status will fetch all callbacks. + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CallbackApi(api_client).get_callbacks_with_http_info(date = date, status = status, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def get_callbacks_with_http_info( + date: Annotated[Optional[datetime], Field(description="Date for which fetch the callback type list. By default, the date will be set to current date.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of the callbacks. Default status will fetch all callbacks.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CallbackListResponse]: + + """Get list of callback types with count for a requested Date. + + Get list of callback types with count for a requested Date. + + :param date: Date for which fetch the callback type list. By default, the date will be set to current date. + :type date: datetime + :param status: Status of the callbacks. Default status will fetch all callbacks. + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CallbackApi(api_client).get_callbacks_with_http_info(date = date, status = status, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def get_callbacks_without_preload_content( + date: Annotated[Optional[datetime], Field(description="Date for which fetch the callback type list. By default, the date will be set to current date.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of the callbacks. Default status will fetch all callbacks.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Get list of callback types with count for a requested Date. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Get list of callback types with count for a requested Date. + :param date: Date for which fetch the callback type list. By default, the date will be set to current date. + :type date: datetime + :param status: Status of the callbacks. Default status will fetch all callbacks. + :type status: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CallbackApi(api_client).get_callbacks( - **kwargs - ) + response = CallbackApi(api_client).get_callbacks_without_preload_content_with_http_info(date = date, status = status, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/CaseAnalytics.py b/unicourt/sdk/CaseAnalytics.py index 251e4d4..5437c41 100644 --- a/unicourt/sdk/CaseAnalytics.py +++ b/unicourt/sdk/CaseAnalytics.py @@ -1,372 +1,2954 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from unicourt.model.case_count_analytics_by_area_of_law_response import CaseCountAnalyticsByAreaOfLawResponse +from unicourt.model.case_count_analytics_by_case_class_response import CaseCountAnalyticsByCaseClassResponse +from unicourt.model.case_count_analytics_by_case_filed_date_response import CaseCountAnalyticsByCaseFiledDateResponse +from unicourt.model.case_count_analytics_by_case_type_group_response import CaseCountAnalyticsByCaseTypeGroupResponse +from unicourt.model.case_count_analytics_by_case_type_response import CaseCountAnalyticsByCaseTypeResponse +from unicourt.model.case_count_analytics_by_court_location_response import CaseCountAnalyticsByCourtLocationResponse +from unicourt.model.case_count_analytics_by_court_response import CaseCountAnalyticsByCourtResponse +from unicourt.model.case_count_analytics_by_court_system_response import CaseCountAnalyticsByCourtSystemResponse +from unicourt.model.case_count_analytics_by_court_type_response import CaseCountAnalyticsByCourtTypeResponse +from unicourt.model.case_count_analytics_by_jurisdiction_geo_response import CaseCountAnalyticsByJurisdictionGeoResponse +from unicourt.model.case_count_analytics_by_norm_attorney_response import CaseCountAnalyticsByNormAttorneyResponse +from unicourt.model.case_count_analytics_by_norm_judge_response import CaseCountAnalyticsByNormJudgeResponse +from unicourt.model.case_count_analytics_by_norm_law_firm_response import CaseCountAnalyticsByNormLawFirmResponse +from unicourt.model.case_count_analytics_by_norm_party_response import CaseCountAnalyticsByNormPartyResponse +from unicourt.model.case_count_analytics_by_party_role_group_response import CaseCountAnalyticsByPartyRoleGroupResponse +from unicourt.model.case_count_analytics_by_party_role_response import CaseCountAnalyticsByPartyRoleResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.case_analytics_api import CaseAnalyticsApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class CaseAnalytics: @staticmethod def get_case_count_analytics_by_area_of_law( - **kwargs - ): - - """Case Count Analytics by Area Of Law. - - - Retrieve case counts by area of law. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Area Of Law of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByAreaOfLawResponse]: + + """Case Count Analytics by Area Of Law. + + Retrieve case counts by area of law. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Area Of Law of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_area_of_law_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_area_of_law_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByAreaOfLawResponse]: + + """Case Count Analytics by Area Of Law. + + Retrieve case counts by area of law. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Area Of Law of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_area_of_law_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_area_of_law_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Area Of Law. + + Retrieve case counts by area of law. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Area Of Law of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_area_of_law( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_area_of_law_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_case_class( - **kwargs - ): - - """Case Count Analytics by Case Class. - - - Retrieve case counts by case class. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Case Class of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByCaseClassResponse]: + + """Case Count Analytics by Case Class. + + Retrieve case counts by case class. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Case Class of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_class_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_case_class_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCaseClassResponse]: + + """Case Count Analytics by Case Class. + + Retrieve case counts by case class. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Case Class of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_class_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_case_class_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Case Class. + + Retrieve case counts by case class. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Case Class of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_class( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_class_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_case_filed_date( - group_by, - **kwargs - ): - - """Case Count Analytics by Case Filed Date. - - - Retrieve case count analytics by filing date. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case filed date of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + group_by: Annotated[StrictStr, Field(description="GroupBy")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByCaseFiledDateResponse]: + + """Case Count Analytics by Case Filed Date. + + Retrieve case count analytics by filing date. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case filed date of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param group_by: GroupBy (required) + :type group_by: str + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_filed_date_with_http_info(group_by = group_by, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_case_filed_date_with_http_info( + group_by: Annotated[StrictStr, Field(description="GroupBy")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCaseFiledDateResponse]: + + """Case Count Analytics by Case Filed Date. + + Retrieve case count analytics by filing date. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case filed date of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param group_by: GroupBy (required) + :type group_by: str + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_filed_date_with_http_info(group_by = group_by, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_case_filed_date_without_preload_content( + group_by: Annotated[StrictStr, Field(description="GroupBy")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Case Filed Date. + + Retrieve case count analytics by filing date. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case filed date of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param group_by: GroupBy (required) + :type group_by: str + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_filed_date( - group_by, - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_filed_date_without_preload_content_with_http_info(group_by = group_by, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_case_type( - **kwargs - ): - - """Case Count Analytics by Case Type. - - - Retrieve case counts by case type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case types of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByCaseTypeResponse]: + + """Case Count Analytics by Case Type. + + Retrieve case counts by case type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case types of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_type_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_case_type_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCaseTypeResponse]: + + """Case Count Analytics by Case Type. + + Retrieve case counts by case type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case types of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_type_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_case_type_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Case Type. + + Retrieve case counts by case type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case types of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_type( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_type_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_case_type_group( - **kwargs - ): - - """Case Count Analytics by Case Type Group. - - - Retrieve case counts by case type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case type catgeory of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByCaseTypeGroupResponse]: + + """Case Count Analytics by Case Type Group. + + Retrieve case counts by case type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case type catgeory of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_type_group_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_case_type_group_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCaseTypeGroupResponse]: + + """Case Count Analytics by Case Type Group. + + Retrieve case counts by case type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case type catgeory of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_type_group_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_case_type_group_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Case Type Group. + + Retrieve case counts by case type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by case type catgeory of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_type_group( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_case_type_group_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_court( - **kwargs - ): - - """Case Count Analytics by Court. - - - Retrieve case counts by court. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Court of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByCourtResponse]: + + """Case Count Analytics by Court. + + Retrieve case counts by court. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Court of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_court_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCourtResponse]: + + """Case Count Analytics by Court. + + Retrieve case counts by court. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Court of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_court_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Court. + + Retrieve case counts by court. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Court of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_court( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_court_location( - **kwargs - ): - - """Case Count Analytics by Court Location. - - - Retrieve case counts by court location. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court location of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByCourtLocationResponse]: + + """Case Count Analytics by Court Location. + + Retrieve case counts by court location. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court location of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_location_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_court_location_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCourtLocationResponse]: + + """Case Count Analytics by Court Location. + + Retrieve case counts by court location. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court location of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_location_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_court_location_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Court Location. + + Retrieve case counts by court location. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court location of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_location( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_location_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_court_system( - **kwargs - ): - - """Case Count Analytics by Court System. - - - Retrieve case counts by court system. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court system of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByCourtSystemResponse]: + + """Case Count Analytics by Court System. + + Retrieve case counts by court system. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court system of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_system_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_court_system_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCourtSystemResponse]: + + """Case Count Analytics by Court System. + + Retrieve case counts by court system. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court system of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_system_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_court_system_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Court System. + + Retrieve case counts by court system. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court system of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_system( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_system_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_court_type( - **kwargs - ): - - """Case Count Analytics by CourtType. - - - Retrieve case counts by court type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court type of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByCourtTypeResponse]: + + """Case Count Analytics by CourtType. + + Retrieve case counts by court type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court type of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_type_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_court_type_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByCourtTypeResponse]: + + """Case Count Analytics by CourtType. + + Retrieve case counts by court type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court type of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_type_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_court_type_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by CourtType. + + Retrieve case counts by court type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by court type of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_type( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_court_type_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_jurisdiction_geo( - **kwargs - ): - - """Case Count Analytics by Jurisdiction Geo. - - - Retrieve case counts by jurisdiction geography. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by jurisdiction geo of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByJurisdictionGeoResponse]: + + """Case Count Analytics by Jurisdiction Geo. + + Retrieve case counts by jurisdiction geography. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by jurisdiction geo of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_jurisdiction_geo_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_jurisdiction_geo_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByJurisdictionGeoResponse]: + + """Case Count Analytics by Jurisdiction Geo. + + Retrieve case counts by jurisdiction geography. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by jurisdiction geo of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_jurisdiction_geo_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_jurisdiction_geo_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Jurisdiction Geo. + + Retrieve case counts by jurisdiction geography. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by jurisdiction geo of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_jurisdiction_geo( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_jurisdiction_geo_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_norm_attorney( - **kwargs - ): - - """Case Count Analytics by Attorney. - - - Retrieve case counts for the specified attorneys. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByNormAttorneyResponse]: + + """Case Count Analytics by Attorney. + + Retrieve case counts for the specified attorneys. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_attorney_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_norm_attorney_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByNormAttorneyResponse]: + + """Case Count Analytics by Attorney. + + Retrieve case counts for the specified attorneys. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_attorney_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_norm_attorney_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Attorney. + + Retrieve case counts for the specified attorneys. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_attorney( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_attorney_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_norm_judge( - **kwargs - ): - - """Case Count Analytics by Judge. - - - Retrieve case counts for judges. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm judge of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByNormJudgeResponse]: + + """Case Count Analytics by Judge. + + Retrieve case counts for judges. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm judge of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_judge_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_norm_judge_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByNormJudgeResponse]: + + """Case Count Analytics by Judge. + + Retrieve case counts for judges. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm judge of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_judge_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_norm_judge_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Judge. + + Retrieve case counts for judges. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm judge of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_judge( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_judge_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_norm_law_firm( - **kwargs - ): - - """Case Count Analytics by Norm Law Firm. - - - Returns Case Analytics by Norm Law Firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByNormLawFirmResponse]: + + """Case Count Analytics by Norm Law Firm. + + Returns Case Analytics by Norm Law Firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_law_firm_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_norm_law_firm_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByNormLawFirmResponse]: + + """Case Count Analytics by Norm Law Firm. + + Returns Case Analytics by Norm Law Firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_law_firm_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_norm_law_firm_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Norm Law Firm. + + Returns Case Analytics by Norm Law Firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The URL encoded query you are searching for. The query can be as simple as a keyword, but supports many additional options and filters. All options are documented above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_law_firm( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_law_firm_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_norm_party( - **kwargs - ): - - """Case Count Analytics by Party. - - - Retrieve case counts for parties. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByNormPartyResponse]: + + """Case Count Analytics by Party. + + Retrieve case counts for parties. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_party_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_norm_party_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByNormPartyResponse]: + + """Case Count Analytics by Party. + + Retrieve case counts for parties. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_party_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_norm_party_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Party. + + Retrieve case counts for parties. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Multiple Ids Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Multiple Ids Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Multiple Ids Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_party( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_norm_party_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney( - norm_attorney_id, - **kwargs - ): - - """Case Count Analytics by Opposing Norm Attorney. - - - Retrieve case counts for attorneys who have appeared as opposing counsel to the specified attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGYevnGAWWENhEQ9\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDpTTZt6KQaRP7Qr\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney with norm id NATYY29p78c7UoyJJ of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the attorney for whom opposing-counsel attorneys are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired opposing counsel attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByNormAttorneyResponse]: + + """Case Count Analytics by Opposing Norm Attorney. + + Retrieve case counts for attorneys who have appeared as opposing counsel to the specified attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGYevnGAWWENhEQ9\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDpTTZt6KQaRP7Qr\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney with norm id NATYY29p78c7UoyJJ of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_attorney_id: The normAttorneyId value of the attorney for whom opposing-counsel attorneys are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired opposing counsel attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney_with_http_info(norm_attorney_id = norm_attorney_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney_with_http_info( + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the attorney for whom opposing-counsel attorneys are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired opposing counsel attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByNormAttorneyResponse]: + + """Case Count Analytics by Opposing Norm Attorney. + + Retrieve case counts for attorneys who have appeared as opposing counsel to the specified attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGYevnGAWWENhEQ9\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDpTTZt6KQaRP7Qr\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney with norm id NATYY29p78c7UoyJJ of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_attorney_id: The normAttorneyId value of the attorney for whom opposing-counsel attorneys are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired opposing counsel attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney_with_http_info(norm_attorney_id = norm_attorney_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney_without_preload_content( + norm_attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normAttorneyId value of the attorney for whom opposing-counsel attorneys are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired opposing counsel attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Opposing Norm Attorney. + + Retrieve case counts for attorneys who have appeared as opposing counsel to the specified attorney. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGYevnGAWWENhEQ9\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDpTTZt6KQaRP7Qr\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm attorney with norm id NATYY29p78c7UoyJJ of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_attorney_id: The normAttorneyId value of the attorney for whom opposing-counsel attorneys are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_attorney_id: str + :param q: The keyword expression targeting the desired opposing counsel attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney( - norm_attorney_id, - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_opposing_norm_attorney_for_a_norm_attorney_without_preload_content_with_http_info(norm_attorney_id = norm_attorney_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm( - norm_law_firm_id, - **kwargs - ): - - """Case Count Analytics by Opposing Norm Law Firm. - - - Retrieve case counts for law firms that have appeared as opposing counsel against the specified law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYp7kmEQtt8jQ3eQ\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the law firm for which opposing firms are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired opposing counsel firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByNormLawFirmResponse]: + + """Case Count Analytics by Opposing Norm Law Firm. + + Retrieve case counts for law firms that have appeared as opposing counsel against the specified law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYp7kmEQtt8jQ3eQ\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_law_firm_id: The normLawFirmId value of the law firm for which opposing firms are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired opposing counsel firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm_with_http_info(norm_law_firm_id = norm_law_firm_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm_with_http_info( + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the law firm for which opposing firms are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired opposing counsel firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByNormLawFirmResponse]: + + """Case Count Analytics by Opposing Norm Law Firm. + + Retrieve case counts for law firms that have appeared as opposing counsel against the specified law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYp7kmEQtt8jQ3eQ\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_law_firm_id: The normLawFirmId value of the law firm for which opposing firms are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired opposing counsel firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm_with_http_info(norm_law_firm_id = norm_law_firm_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm_without_preload_content( + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the law firm for which opposing firms are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired opposing counsel firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Opposing Norm Law Firm. + + Retrieve case counts for law firms that have appeared as opposing counsel against the specified law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYp7kmEQtt8jQ3eQ\"** | | **normPartyId** | Single Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm lawfirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_law_firm_id: The normLawFirmId value of the law firm for which opposing firms are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired opposing counsel firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm( - norm_law_firm_id, - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_opposing_norm_law_firm_for_a_norm_law_firm_without_preload_content_with_http_info(norm_law_firm_id = norm_law_firm_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_opposing_norm_party_for_a_norm_party( - norm_party_id, - **kwargs - ): - - """Case Count Analytics by Opposing Norm Party. - - - Retrieve case counts for parties that have opposed the specified party. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the party for which opposing parties are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the opposing parties that should be retrieved. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByNormPartyResponse]: + + """Case Count Analytics by Opposing Norm Party. + + Retrieve case counts for parties that have opposed the specified party. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_party_id: The normPartyId value of the party for which opposing parties are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the opposing parties that should be retrieved. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_opposing_norm_party_for_a_norm_party_with_http_info(norm_party_id = norm_party_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_opposing_norm_party_for_a_norm_party_with_http_info( + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the party for which opposing parties are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the opposing parties that should be retrieved. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByNormPartyResponse]: + + """Case Count Analytics by Opposing Norm Party. + + Retrieve case counts for parties that have opposed the specified party. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_party_id: The normPartyId value of the party for which opposing parties are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the opposing parties that should be retrieved. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_opposing_norm_party_for_a_norm_party_with_http_info(norm_party_id = norm_party_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_opposing_norm_party_for_a_norm_party_without_preload_content( + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the party for which opposing parties are to be retrieved. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the opposing parties that should be retrieved. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Opposing Norm Party. + + Retrieve case counts for parties that have opposed the specified party. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normAttorneyId** | Single Allowed |Find Analytics for a particular norm Attorney Object. | **normAttorneyId:\"NATYfwmXwRHS279WPY\"** | | **normLawFirmId** | Single Allowed |Find Analytics for a particular Norm LawFirm Object. | **normLawFirmId:\"NORGrPmQyLdx9NGHcT\"** | | **normJudgeId** | Single Allowed |Find Analytics for a particular Judge Object. | **normJudgeId:\"NJUDT7jCZyFNeLGpRq\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by norm party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2013 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2013-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_party_id: The normPartyId value of the party for which opposing parties are to be retrieved. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the opposing parties that should be retrieved. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_opposing_norm_party_for_a_norm_party( - norm_party_id, - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_opposing_norm_party_for_a_norm_party_without_preload_content_with_http_info(norm_party_id = norm_party_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_party_role( - **kwargs - ): - - """Case Count Analytics by Party Role. - - - Retrieve case counts by party type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by party role of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByPartyRoleResponse]: + + """Case Count Analytics by Party Role. + + Retrieve case counts by party type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by party role of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_party_role_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_party_role_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByPartyRoleResponse]: + + """Case Count Analytics by Party Role. + + Retrieve case counts by party type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by party role of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_party_role_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_party_role_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Party Role. + + Retrieve case counts by party type. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by party role of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_party_role( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_party_role_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_count_analytics_by_party_role_group( - **kwargs - ): - - """Case Count Analytics by Party Role Group. - - - Retrieve case counts by party type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Party Role Group of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseCountAnalyticsByPartyRoleGroupResponse]: + + """Case Count Analytics by Party Role Group. + + Retrieve case counts by party type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Party Role Group of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_party_role_group_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_count_analytics_by_party_role_group_with_http_info( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseCountAnalyticsByPartyRoleGroupResponse]: + + """Case Count Analytics by Party Role Group. + + Retrieve case counts by party type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Party Role Group of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseAnalyticsApi(api_client).get_case_count_analytics_by_party_role_group_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_count_analytics_by_party_role_group_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Count Analytics by Party Role Group. + + Retrieve case counts by party type group. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **normPartyId** | Multiple Ids Allowed |Find Analytics for a particular Party Object. | **normPartyId:\"NORGrPmQyLdx9NGHcT\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get case count grouped by Party Role Group of all cases with case type id CTYPGkaW3aGJyKGyfn and filed between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param q: The keyword expression targeting the desired cases. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseAnalyticsApi(api_client).get_case_count_analytics_by_party_role_group( - **kwargs - ) + response = CaseAnalyticsApi(api_client).get_case_count_analytics_by_party_role_group_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/CaseDocket.py b/unicourt/sdk/CaseDocket.py index a223520..a4ebb97 100644 --- a/unicourt/sdk/CaseDocket.py +++ b/unicourt/sdk/CaseDocket.py @@ -1,301 +1,2282 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from datetime import datetime +from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from unicourt.model.attorney import Attorney +from unicourt.model.attorneys import Attorneys +from unicourt.model.case import Case +from unicourt.model.docket_entries import DocketEntries +from unicourt.model.docket_entry_primary_documents import DocketEntryPrimaryDocuments +from unicourt.model.docket_entry_secondary_documents import DocketEntrySecondaryDocuments +from unicourt.model.hearings import Hearings +from unicourt.model.judge import Judge +from unicourt.model.judges import Judges +from unicourt.model.parties import Parties +from unicourt.model.party import Party +from unicourt.model.party_attorney_associations import PartyAttorneyAssociations +from unicourt.model.related_cases import RelatedCases +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.case_docket_api import CaseDocketApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class CaseDocket: @staticmethod def get_attorney_associated_parties( - attorney_id, - **kwargs - ): - - """Gets Associated Party details for a requested Attorney ID. - - - Retrieve the parties represented by the attorney with the specified attorneyId value. + attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the parties represented by the attorney with the specified attorneyId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PartyAttorneyAssociations]: + + """Gets Associated Party details for a requested Attorney ID. + + Retrieve the parties represented by the attorney with the specified attorneyId value. + + :param attorney_id: Retrieve the parties represented by the attorney with the specified attorneyId value. (required) + :type attorney_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocketApi(api_client).get_attorney_associated_parties_with_http_info(attorney_id = attorney_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_attorney_associated_parties_with_http_info( + attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the parties represented by the attorney with the specified attorneyId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PartyAttorneyAssociations]: + + """Gets Associated Party details for a requested Attorney ID. + + Retrieve the parties represented by the attorney with the specified attorneyId value. + + :param attorney_id: Retrieve the parties represented by the attorney with the specified attorneyId value. (required) + :type attorney_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocketApi(api_client).get_attorney_associated_parties_with_http_info(attorney_id = attorney_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_attorney_associated_parties_without_preload_content( + attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the parties represented by the attorney with the specified attorneyId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets Associated Party details for a requested Attorney ID. + + Retrieve the parties represented by the attorney with the specified attorneyId value. + + :param attorney_id: Retrieve the parties represented by the attorney with the specified attorneyId value. (required) + :type attorney_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocketApi(api_client).get_attorney_associated_parties( - attorney_id, - **kwargs - ) + response = CaseDocketApi(api_client).get_attorney_associated_parties_without_preload_content_with_http_info(attorney_id = attorney_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_attorney_by_id( - attorney_id, - **kwargs - ): - - """Gets details for a requested Attorney ID. - - - Retrieve the attorney with the specified attorneyId value. + attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the attorney with the specified attorneyId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[Attorney]: + + """Gets details for a requested Attorney ID. + + Retrieve the attorney with the specified attorneyId value. + + :param attorney_id: Retrieve the attorney with the specified attorneyId value. (required) + :type attorney_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocketApi(api_client).get_attorney_by_id_with_http_info(attorney_id = attorney_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_attorney_by_id_with_http_info( + attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the attorney with the specified attorneyId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Attorney]: + + """Gets details for a requested Attorney ID. + + Retrieve the attorney with the specified attorneyId value. + + :param attorney_id: Retrieve the attorney with the specified attorneyId value. (required) + :type attorney_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocketApi(api_client).get_attorney_by_id_with_http_info(attorney_id = attorney_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_attorney_by_id_without_preload_content( + attorney_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the attorney with the specified attorneyId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets details for a requested Attorney ID. + + Retrieve the attorney with the specified attorneyId value. + + :param attorney_id: Retrieve the attorney with the specified attorneyId value. (required) + :type attorney_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocketApi(api_client).get_attorney_by_id( - attorney_id, - **kwargs - ) + response = CaseDocketApi(api_client).get_attorney_by_id_without_preload_content_with_http_info(attorney_id = attorney_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case( - case_id, - **kwargs - ): - - """Gets case information for a requested Case ID. - - - Retrieve the case with the specified caseId value. + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[Case]: + + """Gets case information for a requested Case ID. + + Retrieve the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocketApi(api_client).get_case_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_with_http_info( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Case]: + + """Gets case information for a requested Case ID. + + Retrieve the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocketApi(api_client).get_case_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_without_preload_content( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets case information for a requested Case ID. + + Retrieve the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocketApi(api_client).get_case( - case_id, - **kwargs - ) + response = CaseDocketApi(api_client).get_case_without_preload_content_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_attorneys( - case_id, - **kwargs - ): - - """Gets Attorneys for a requested Case ID. - - - Retrieve the attorneys in the case with the specified caseId value. + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve attorneys in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[Attorneys]: + + """Gets Attorneys for a requested Case ID. + + Retrieve the attorneys in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve attorneys in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocketApi(api_client).get_case_attorneys_with_http_info(case_id = case_id, is_visible = is_visible, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_attorneys_with_http_info( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve attorneys in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Attorneys]: + + """Gets Attorneys for a requested Case ID. + + Retrieve the attorneys in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve attorneys in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocketApi(api_client).get_case_attorneys_with_http_info(case_id = case_id, is_visible = is_visible, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_attorneys_without_preload_content( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve attorneys in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets Attorneys for a requested Case ID. + + Retrieve the attorneys in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve attorneys in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocketApi(api_client).get_case_attorneys( - case_id, - **kwargs - ) + response = CaseDocketApi(api_client).get_case_attorneys_without_preload_content_with_http_info(case_id = case_id, is_visible = is_visible, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_docket_entries( - case_id, - **kwargs - ): - - """Gets Docket Entries for a requested Case ID. - - - Retrieve the docket entries in the case with the specified caseId value. + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + docket_number: Annotated[Optional[StrictInt], Field(description="Retrieve the docket entry witih the specified docket number in the case with the specified caseId value.")] = None, + sort_by: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=20)]], Field(description="Sort the retrieved docket entries in ascending order or descending order of date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[DocketEntries]: + + """Gets Docket Entries for a requested Case ID. + + Retrieve the docket entries in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param docket_number: Retrieve the docket entry witih the specified docket number in the case with the specified caseId value. + :type docket_number: int + :param sort_by: Sort the retrieved docket entries in ascending order or descending order of date. + :type sort_by: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocketApi(api_client).get_case_docket_entries_with_http_info(case_id = case_id, docket_number = docket_number, sort_by = sort_by, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_docket_entries_with_http_info( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + docket_number: Annotated[Optional[StrictInt], Field(description="Retrieve the docket entry witih the specified docket number in the case with the specified caseId value.")] = None, + sort_by: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=20)]], Field(description="Sort the retrieved docket entries in ascending order or descending order of date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocketEntries]: + + """Gets Docket Entries for a requested Case ID. + + Retrieve the docket entries in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param docket_number: Retrieve the docket entry witih the specified docket number in the case with the specified caseId value. + :type docket_number: int + :param sort_by: Sort the retrieved docket entries in ascending order or descending order of date. + :type sort_by: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocketApi(api_client).get_case_docket_entries_with_http_info(case_id = case_id, docket_number = docket_number, sort_by = sort_by, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_docket_entries_without_preload_content( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + docket_number: Annotated[Optional[StrictInt], Field(description="Retrieve the docket entry witih the specified docket number in the case with the specified caseId value.")] = None, + sort_by: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=20)]], Field(description="Sort the retrieved docket entries in ascending order or descending order of date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets Docket Entries for a requested Case ID. + + Retrieve the docket entries in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param docket_number: Retrieve the docket entry witih the specified docket number in the case with the specified caseId value. + :type docket_number: int + :param sort_by: Sort the retrieved docket entries in ascending order or descending order of date. + :type sort_by: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocketApi(api_client).get_case_docket_entries( - case_id, - **kwargs - ) + response = CaseDocketApi(api_client).get_case_docket_entries_without_preload_content_with_http_info(case_id = case_id, docket_number = docket_number, sort_by = sort_by, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_hearings( - case_id, - **kwargs - ): - - """Gets Hearings for a requested Case ID. - - - Gets Hearings for a requested Case ID. + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + sort_by: Annotated[Optional[StrictStr], Field(description="Specify the sort order of hearings in the case with the specified caseId.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[Hearings]: + + """Gets Hearings for a requested Case ID. + + Gets Hearings for a requested Case ID. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param sort_by: Specify the sort order of hearings in the case with the specified caseId. + :type sort_by: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocketApi(api_client).get_case_hearings_with_http_info(case_id = case_id, sort_by = sort_by, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_hearings_with_http_info( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + sort_by: Annotated[Optional[StrictStr], Field(description="Specify the sort order of hearings in the case with the specified caseId.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Hearings]: + + """Gets Hearings for a requested Case ID. + + Gets Hearings for a requested Case ID. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param sort_by: Specify the sort order of hearings in the case with the specified caseId. + :type sort_by: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocketApi(api_client).get_case_hearings_with_http_info(case_id = case_id, sort_by = sort_by, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_hearings_without_preload_content( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + sort_by: Annotated[Optional[StrictStr], Field(description="Specify the sort order of hearings in the case with the specified caseId.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets Hearings for a requested Case ID. + + Gets Hearings for a requested Case ID. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param sort_by: Specify the sort order of hearings in the case with the specified caseId. + :type sort_by: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocketApi(api_client).get_case_hearings( - case_id, - **kwargs - ) + response = CaseDocketApi(api_client).get_case_hearings_without_preload_content_with_http_info(case_id = case_id, sort_by = sort_by, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_judges( - case_id, - **kwargs - ): - - """Gets Judges for a requested Case ID. - - - Retrieve the judges involved in the specified case. + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve attorneys judges in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[Judges]: + + """Gets Judges for a requested Case ID. + + Retrieve the judges involved in the specified case. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve attorneys judges in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocketApi(api_client).get_case_judges_with_http_info(case_id = case_id, is_visible = is_visible, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_judges_with_http_info( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve attorneys judges in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Judges]: + + """Gets Judges for a requested Case ID. + + Retrieve the judges involved in the specified case. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve attorneys judges in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocketApi(api_client).get_case_judges_with_http_info(case_id = case_id, is_visible = is_visible, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_judges_without_preload_content( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve attorneys judges in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets Judges for a requested Case ID. + + Retrieve the judges involved in the specified case. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve attorneys judges in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocketApi(api_client).get_case_judges( - case_id, - **kwargs - ) + response = CaseDocketApi(api_client).get_case_judges_without_preload_content_with_http_info(case_id = case_id, is_visible = is_visible, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_parties( - case_id, - **kwargs - ): - - """Gets Parties for a requested Case ID. - - - Retrieve the parties involved in the case with the specified caseId value. + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve parties in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + party_role_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified partyRoleId value in the case with the specified caseId value.")] = None, + party_role_group_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified partyRoleGroupId value in the case with the specified caseId value.")] = None, + attorney_representation_type_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified attorneyRepresentationTypeId value in the case with the specified caseId value.")] = None, + party_classification_type: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=10)]], Field(description="Retrieve all parties with the specified partyClassificationType value in the case with the specified caseId value.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[Parties]: + + """Gets Parties for a requested Case ID. + + Retrieve the parties involved in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve parties in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param party_role_id: Retrieve all parties with the specified partyRoleId value in the case with the specified caseId value. + :type party_role_id: str + :param party_role_group_id: Retrieve all parties with the specified partyRoleGroupId value in the case with the specified caseId value. + :type party_role_group_id: str + :param attorney_representation_type_id: Retrieve all parties with the specified attorneyRepresentationTypeId value in the case with the specified caseId value. + :type attorney_representation_type_id: str + :param party_classification_type: Retrieve all parties with the specified partyClassificationType value in the case with the specified caseId value. + :type party_classification_type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocketApi(api_client).get_case_parties_with_http_info(case_id = case_id, is_visible = is_visible, page_number = page_number, party_role_id = party_role_id, party_role_group_id = party_role_group_id, attorney_representation_type_id = attorney_representation_type_id, party_classification_type = party_classification_type, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_parties_with_http_info( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve parties in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + party_role_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified partyRoleId value in the case with the specified caseId value.")] = None, + party_role_group_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified partyRoleGroupId value in the case with the specified caseId value.")] = None, + attorney_representation_type_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified attorneyRepresentationTypeId value in the case with the specified caseId value.")] = None, + party_classification_type: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=10)]], Field(description="Retrieve all parties with the specified partyClassificationType value in the case with the specified caseId value.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Parties]: + + """Gets Parties for a requested Case ID. + + Retrieve the parties involved in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve parties in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param party_role_id: Retrieve all parties with the specified partyRoleId value in the case with the specified caseId value. + :type party_role_id: str + :param party_role_group_id: Retrieve all parties with the specified partyRoleGroupId value in the case with the specified caseId value. + :type party_role_group_id: str + :param attorney_representation_type_id: Retrieve all parties with the specified attorneyRepresentationTypeId value in the case with the specified caseId value. + :type attorney_representation_type_id: str + :param party_classification_type: Retrieve all parties with the specified partyClassificationType value in the case with the specified caseId value. + :type party_classification_type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocketApi(api_client).get_case_parties_with_http_info(case_id = case_id, is_visible = is_visible, page_number = page_number, party_role_id = party_role_id, party_role_group_id = party_role_group_id, attorney_representation_type_id = attorney_representation_type_id, party_classification_type = party_classification_type, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_parties_without_preload_content( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + is_visible: Annotated[Optional[StrictBool], Field(description="Retrieve parties in the case with the specified caseId value whose isVisible flag is set to the specified value.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + party_role_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified partyRoleId value in the case with the specified caseId value.")] = None, + party_role_group_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified partyRoleGroupId value in the case with the specified caseId value.")] = None, + attorney_representation_type_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="Retrieve all parties with the specified attorneyRepresentationTypeId value in the case with the specified caseId value.")] = None, + party_classification_type: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=10)]], Field(description="Retrieve all parties with the specified partyClassificationType value in the case with the specified caseId value.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets Parties for a requested Case ID. + + Retrieve the parties involved in the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param is_visible: Retrieve parties in the case with the specified caseId value whose isVisible flag is set to the specified value. + :type is_visible: bool + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param party_role_id: Retrieve all parties with the specified partyRoleId value in the case with the specified caseId value. + :type party_role_id: str + :param party_role_group_id: Retrieve all parties with the specified partyRoleGroupId value in the case with the specified caseId value. + :type party_role_group_id: str + :param attorney_representation_type_id: Retrieve all parties with the specified attorneyRepresentationTypeId value in the case with the specified caseId value. + :type attorney_representation_type_id: str + :param party_classification_type: Retrieve all parties with the specified partyClassificationType value in the case with the specified caseId value. + :type party_classification_type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocketApi(api_client).get_case_parties( - case_id, - **kwargs - ) + response = CaseDocketApi(api_client).get_case_parties_without_preload_content_with_http_info(case_id = case_id, is_visible = is_visible, page_number = page_number, party_role_id = party_role_id, party_role_group_id = party_role_group_id, attorney_representation_type_id = attorney_representation_type_id, party_classification_type = party_classification_type, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_related_cases( - case_id, - **kwargs - ): - - """Gets Related Cases for a requested Case ID. - - - Retrieve cases that UniCourt has identified as related to the case with the specified caseId value. + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RelatedCases]: + + """Gets Related Cases for a requested Case ID. + + Retrieve cases that UniCourt has identified as related to the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocketApi(api_client).get_case_related_cases_with_http_info(case_id = case_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_related_cases_with_http_info( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RelatedCases]: + + """Gets Related Cases for a requested Case ID. + + Retrieve cases that UniCourt has identified as related to the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocketApi(api_client).get_case_related_cases_with_http_info(case_id = case_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_related_cases_without_preload_content( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets Related Cases for a requested Case ID. + + Retrieve cases that UniCourt has identified as related to the case with the specified caseId value. + + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocketApi(api_client).get_case_related_cases( - case_id, - **kwargs - ) + response = CaseDocketApi(api_client).get_case_related_cases_without_preload_content_with_http_info(case_id = case_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_judge_by_id( - judge_id, - **kwargs - ): - - """Gets details for a requested Judge ID. - - - Retrieve the judge with the specified judgeId value. + judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the judge with the specified judgeId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[Judge]: + + """Gets details for a requested Judge ID. + + Retrieve the judge with the specified judgeId value. + + :param judge_id: Retrieve the judge with the specified judgeId value. (required) + :type judge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocketApi(api_client).get_judge_by_id_with_http_info(judge_id = judge_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_judge_by_id_with_http_info( + judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the judge with the specified judgeId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Judge]: + + """Gets details for a requested Judge ID. + + Retrieve the judge with the specified judgeId value. + + :param judge_id: Retrieve the judge with the specified judgeId value. (required) + :type judge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocketApi(api_client).get_judge_by_id_with_http_info(judge_id = judge_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_judge_by_id_without_preload_content( + judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the judge with the specified judgeId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets details for a requested Judge ID. + + Retrieve the judge with the specified judgeId value. + + :param judge_id: Retrieve the judge with the specified judgeId value. (required) + :type judge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocketApi(api_client).get_judge_by_id( - judge_id, - **kwargs - ) + response = CaseDocketApi(api_client).get_judge_by_id_without_preload_content_with_http_info(judge_id = judge_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_party_associated_attorneys( - party_id, - **kwargs - ): - - """Gets Associated Attorney details for a requested Party ID. - - - Retrieve the attorneys in the case with the specified partyId value. + party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the party with the specified partyId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PartyAttorneyAssociations]: + + """Gets Associated Attorney details for a requested Party ID. + + Retrieve the attorneys in the case with the specified partyId value. + + :param party_id: Retrieve the party with the specified partyId value. (required) + :type party_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocketApi(api_client).get_party_associated_attorneys_with_http_info(party_id = party_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_party_associated_attorneys_with_http_info( + party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the party with the specified partyId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PartyAttorneyAssociations]: + + """Gets Associated Attorney details for a requested Party ID. + + Retrieve the attorneys in the case with the specified partyId value. + + :param party_id: Retrieve the party with the specified partyId value. (required) + :type party_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocketApi(api_client).get_party_associated_attorneys_with_http_info(party_id = party_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_party_associated_attorneys_without_preload_content( + party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the party with the specified partyId value.")], + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets Associated Attorney details for a requested Party ID. + + Retrieve the attorneys in the case with the specified partyId value. + + :param party_id: Retrieve the party with the specified partyId value. (required) + :type party_id: str + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocketApi(api_client).get_party_associated_attorneys( - party_id, - **kwargs - ) + response = CaseDocketApi(api_client).get_party_associated_attorneys_without_preload_content_with_http_info(party_id = party_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_party_by_id( - party_id, - **kwargs - ): - - """Gets details for a requested Party ID. - - - Retrieve the party with the specified partyId value. + party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the party with the specified partyId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[Party]: + + """Gets details for a requested Party ID. + + Retrieve the party with the specified partyId value. + + :param party_id: Retrieve the party with the specified partyId value. (required) + :type party_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocketApi(api_client).get_party_by_id_with_http_info(party_id = party_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_party_by_id_with_http_info( + party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the party with the specified partyId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Party]: + + """Gets details for a requested Party ID. + + Retrieve the party with the specified partyId value. + + :param party_id: Retrieve the party with the specified partyId value. (required) + :type party_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocketApi(api_client).get_party_by_id_with_http_info(party_id = party_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_party_by_id_without_preload_content( + party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the party with the specified partyId value.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets details for a requested Party ID. + + Retrieve the party with the specified partyId value. + + :param party_id: Retrieve the party with the specified partyId value. (required) + :type party_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocketApi(api_client).get_party_by_id( - party_id, - **kwargs - ) + response = CaseDocketApi(api_client).get_party_by_id_without_preload_content_with_http_info(party_id = party_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_primary_documents_for_docket_entries( - case_id, - docket_number, - **kwargs - ): - - """Gets Primary Documents of Docket Entries. - - - Retrieve the primary documents in the case with the specified caseId value. + docket_number: Annotated[StrictInt, Field(description="Retrieve the primary documents associated with the specified docket number in the case with the specified caseId value.")], + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + in_library: Annotated[Optional[StrictBool], Field(description="Retrieve the primary documents in the with the specified inLibrary flag in the case with the specified caseId value.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Retrieve all primary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Retrieve all primary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[DocketEntryPrimaryDocuments]: + + """Gets Primary Documents of Docket Entries. + + Retrieve the primary documents in the case with the specified caseId value. + + :param docket_number: Retrieve the primary documents associated with the specified docket number in the case with the specified caseId value. (required) + :type docket_number: int + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param in_library: Retrieve the primary documents in the with the specified inLibrary flag in the case with the specified caseId value. + :type in_library: bool + :param after_first_fetch_date: Retrieve all primary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date. + :type after_first_fetch_date: datetime + :param library_date: Retrieve all primary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date. + :type library_date: datetime + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocketApi(api_client).get_primary_documents_for_docket_entries_with_http_info(docket_number = docket_number, case_id = case_id, in_library = in_library, after_first_fetch_date = after_first_fetch_date, library_date = library_date, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_primary_documents_for_docket_entries_with_http_info( + docket_number: Annotated[StrictInt, Field(description="Retrieve the primary documents associated with the specified docket number in the case with the specified caseId value.")], + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + in_library: Annotated[Optional[StrictBool], Field(description="Retrieve the primary documents in the with the specified inLibrary flag in the case with the specified caseId value.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Retrieve all primary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Retrieve all primary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocketEntryPrimaryDocuments]: + + """Gets Primary Documents of Docket Entries. + + Retrieve the primary documents in the case with the specified caseId value. + + :param docket_number: Retrieve the primary documents associated with the specified docket number in the case with the specified caseId value. (required) + :type docket_number: int + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param in_library: Retrieve the primary documents in the with the specified inLibrary flag in the case with the specified caseId value. + :type in_library: bool + :param after_first_fetch_date: Retrieve all primary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date. + :type after_first_fetch_date: datetime + :param library_date: Retrieve all primary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date. + :type library_date: datetime + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocketApi(api_client).get_primary_documents_for_docket_entries_with_http_info(docket_number = docket_number, case_id = case_id, in_library = in_library, after_first_fetch_date = after_first_fetch_date, library_date = library_date, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_primary_documents_for_docket_entries_without_preload_content( + docket_number: Annotated[StrictInt, Field(description="Retrieve the primary documents associated with the specified docket number in the case with the specified caseId value.")], + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + in_library: Annotated[Optional[StrictBool], Field(description="Retrieve the primary documents in the with the specified inLibrary flag in the case with the specified caseId value.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Retrieve all primary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Retrieve all primary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets Primary Documents of Docket Entries. + + Retrieve the primary documents in the case with the specified caseId value. + + :param docket_number: Retrieve the primary documents associated with the specified docket number in the case with the specified caseId value. (required) + :type docket_number: int + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param in_library: Retrieve the primary documents in the with the specified inLibrary flag in the case with the specified caseId value. + :type in_library: bool + :param after_first_fetch_date: Retrieve all primary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date. + :type after_first_fetch_date: datetime + :param library_date: Retrieve all primary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date. + :type library_date: datetime + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocketApi(api_client).get_primary_documents_for_docket_entries( - case_id, - docket_number, - **kwargs - ) + response = CaseDocketApi(api_client).get_primary_documents_for_docket_entries_without_preload_content_with_http_info(docket_number = docket_number, case_id = case_id, in_library = in_library, after_first_fetch_date = after_first_fetch_date, library_date = library_date, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_secondary_documents_for_docket_entries( - case_id, - docket_number, - **kwargs - ): - - """Gets Secondary Documents of Docket Entries. - - - Retrieve the secondary documents in the case with the specified caseId value. + docket_number: Annotated[StrictInt, Field(description="Retrieve the secondary documents associated with the specified docket number in the case with the specified caseId value.")], + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + in_library: Annotated[Optional[StrictBool], Field(description="Retrieve the secondary documents in the with the specified inLibrary flag in the case with the specified caseId value.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Retrieve all secondary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Retrieve all secondary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[DocketEntrySecondaryDocuments]: + + """Gets Secondary Documents of Docket Entries. + + Retrieve the secondary documents in the case with the specified caseId value. + + :param docket_number: Retrieve the secondary documents associated with the specified docket number in the case with the specified caseId value. (required) + :type docket_number: int + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param in_library: Retrieve the secondary documents in the with the specified inLibrary flag in the case with the specified caseId value. + :type in_library: bool + :param after_first_fetch_date: Retrieve all secondary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date. + :type after_first_fetch_date: datetime + :param library_date: Retrieve all secondary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date. + :type library_date: datetime + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocketApi(api_client).get_secondary_documents_for_docket_entries_with_http_info(docket_number = docket_number, case_id = case_id, in_library = in_library, after_first_fetch_date = after_first_fetch_date, library_date = library_date, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_secondary_documents_for_docket_entries_with_http_info( + docket_number: Annotated[StrictInt, Field(description="Retrieve the secondary documents associated with the specified docket number in the case with the specified caseId value.")], + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + in_library: Annotated[Optional[StrictBool], Field(description="Retrieve the secondary documents in the with the specified inLibrary flag in the case with the specified caseId value.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Retrieve all secondary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Retrieve all secondary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocketEntrySecondaryDocuments]: + + """Gets Secondary Documents of Docket Entries. + + Retrieve the secondary documents in the case with the specified caseId value. + + :param docket_number: Retrieve the secondary documents associated with the specified docket number in the case with the specified caseId value. (required) + :type docket_number: int + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param in_library: Retrieve the secondary documents in the with the specified inLibrary flag in the case with the specified caseId value. + :type in_library: bool + :param after_first_fetch_date: Retrieve all secondary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date. + :type after_first_fetch_date: datetime + :param library_date: Retrieve all secondary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date. + :type library_date: datetime + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocketApi(api_client).get_secondary_documents_for_docket_entries_with_http_info(docket_number = docket_number, case_id = case_id, in_library = in_library, after_first_fetch_date = after_first_fetch_date, library_date = library_date, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_secondary_documents_for_docket_entries_without_preload_content( + docket_number: Annotated[StrictInt, Field(description="Retrieve the secondary documents associated with the specified docket number in the case with the specified caseId value.")], + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Retrieve the case with the specified caseId value.")], + in_library: Annotated[Optional[StrictBool], Field(description="Retrieve the secondary documents in the with the specified inLibrary flag in the case with the specified caseId value.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Retrieve all secondary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Retrieve all secondary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="Query parameter specifying the page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets Secondary Documents of Docket Entries. + + Retrieve the secondary documents in the case with the specified caseId value. + + :param docket_number: Retrieve the secondary documents associated with the specified docket number in the case with the specified caseId value. (required) + :type docket_number: int + :param case_id: Retrieve the case with the specified caseId value. (required) + :type case_id: str + :param in_library: Retrieve the secondary documents in the with the specified inLibrary flag in the case with the specified caseId value. + :type in_library: bool + :param after_first_fetch_date: Retrieve all secondary documents in the case with the specified caseId value that were first fetched by UniCourt on the specified date or within the specified date. + :type after_first_fetch_date: datetime + :param library_date: Retrieve all secondary documents in the case with the specified caseId value that were added to the Crowdsourced Library on the specified date or within the specified date. + :type library_date: datetime + :param page_number: Query parameter specifying the page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocketApi(api_client).get_secondary_documents_for_docket_entries( - case_id, - docket_number, - **kwargs - ) + response = CaseDocketApi(api_client).get_secondary_documents_for_docket_entries_without_preload_content_with_http_info(docket_number = docket_number, case_id = case_id, in_library = in_library, after_first_fetch_date = after_first_fetch_date, library_date = library_date, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/CaseDocuments.py b/unicourt/sdk/CaseDocuments.py index 09ab068..2b0b694 100644 --- a/unicourt/sdk/CaseDocuments.py +++ b/unicourt/sdk/CaseDocuments.py @@ -1,125 +1,960 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from datetime import datetime +from pydantic import Field, StrictBool, StrictInt, field_validator +from typing import Optional +from typing_extensions import Annotated +from unicourt.model.case_document import CaseDocument +from unicourt.model.case_document_order_callback import CaseDocumentOrderCallback +from unicourt.model.case_document_order_callback_list_response import CaseDocumentOrderCallbackListResponse +from unicourt.model.case_document_order_request import CaseDocumentOrderRequest +from unicourt.model.case_documents import CaseDocuments +from unicourt.model.document_download import DocumentDownload +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.case_documents_api import CaseDocumentsApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class CaseDocuments: @staticmethod def get_case_document_download_by_id( - case_document_id, - **kwargs - ): - - """Gets downloadable URL for a requested Document ID. - - - Gets downloadable URL for a requested Document ID. + case_document_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Document ID which you want to download.")], + is_preview_document: Annotated[Optional[StrictBool], Field(description="If the document you want to download is a preview of a document.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[DocumentDownload]: + + """Gets downloadable URL for a requested Document ID. + + Gets downloadable URL for a requested Document ID. + + :param case_document_id: Document ID which you want to download. (required) + :type case_document_id: str + :param is_preview_document: If the document you want to download is a preview of a document. + :type is_preview_document: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocumentsApi(api_client).get_case_document_download_by_id_with_http_info(case_document_id = case_document_id, is_preview_document = is_preview_document, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_document_download_by_id_with_http_info( + case_document_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Document ID which you want to download.")], + is_preview_document: Annotated[Optional[StrictBool], Field(description="If the document you want to download is a preview of a document.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DocumentDownload]: + + """Gets downloadable URL for a requested Document ID. + + Gets downloadable URL for a requested Document ID. + + :param case_document_id: Document ID which you want to download. (required) + :type case_document_id: str + :param is_preview_document: If the document you want to download is a preview of a document. + :type is_preview_document: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocumentsApi(api_client).get_case_document_download_by_id_with_http_info(case_document_id = case_document_id, is_preview_document = is_preview_document, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_document_download_by_id_without_preload_content( + case_document_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Document ID which you want to download.")], + is_preview_document: Annotated[Optional[StrictBool], Field(description="If the document you want to download is a preview of a document.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets downloadable URL for a requested Document ID. + + Gets downloadable URL for a requested Document ID. + + :param case_document_id: Document ID which you want to download. (required) + :type case_document_id: str + :param is_preview_document: If the document you want to download is a preview of a document. + :type is_preview_document: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocumentsApi(api_client).get_case_document_download_by_id( - case_document_id, - **kwargs - ) + response = CaseDocumentsApi(api_client).get_case_document_download_by_id_without_preload_content_with_http_info(case_document_id = case_document_id, is_preview_document = is_preview_document, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_document_order_callback_by_id( - case_document_order_callback_id, - **kwargs - ): - - """Get Case Document Order Callback for a requested Case Document Order Callback Id. - - - Get Case Document Order Callback for a requested Case Document Order Callback Id. + case_document_order_callback_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Unique Id for the Case Document Order Callback.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseDocumentOrderCallback]: + + """Get Case Document Order Callback for a requested Case Document Order Callback Id. + + Get Case Document Order Callback for a requested Case Document Order Callback Id. + + :param case_document_order_callback_id: Unique Id for the Case Document Order Callback. (required) + :type case_document_order_callback_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocumentsApi(api_client).get_case_document_order_callback_by_id_with_http_info(case_document_order_callback_id = case_document_order_callback_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_document_order_callback_by_id_with_http_info( + case_document_order_callback_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Unique Id for the Case Document Order Callback.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseDocumentOrderCallback]: + + """Get Case Document Order Callback for a requested Case Document Order Callback Id. + + Get Case Document Order Callback for a requested Case Document Order Callback Id. + + :param case_document_order_callback_id: Unique Id for the Case Document Order Callback. (required) + :type case_document_order_callback_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocumentsApi(api_client).get_case_document_order_callback_by_id_with_http_info(case_document_order_callback_id = case_document_order_callback_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_document_order_callback_by_id_without_preload_content( + case_document_order_callback_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Unique Id for the Case Document Order Callback.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Get Case Document Order Callback for a requested Case Document Order Callback Id. + + Get Case Document Order Callback for a requested Case Document Order Callback Id. + + :param case_document_order_callback_id: Unique Id for the Case Document Order Callback. (required) + :type case_document_order_callback_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocumentsApi(api_client).get_case_document_order_callback_by_id( - case_document_order_callback_id, - **kwargs - ) + response = CaseDocumentsApi(api_client).get_case_document_order_callback_by_id_without_preload_content_with_http_info(case_document_order_callback_id = case_document_order_callback_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_document_order_callbacks( - **kwargs - ): - - """Get Case Document Order Callback list for a requested Date. - - - Get Case Document Order Callback list for a requested Date. + date: Annotated[Optional[datetime], Field(description="Date for which fetch the Case Document Order Callback list. By default, the date will be set to current date.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of Document Order callbacks. Default status will fetch all callbacks.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page to fetch the Case Document Order Callback list.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseDocumentOrderCallbackListResponse]: + + """Get Case Document Order Callback list for a requested Date. + + Get Case Document Order Callback list for a requested Date. + + :param date: Date for which fetch the Case Document Order Callback list. By default, the date will be set to current date. + :type date: datetime + :param status: Status of Document Order callbacks. Default status will fetch all callbacks. + :type status: str + :param page_number: Page to fetch the Case Document Order Callback list.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocumentsApi(api_client).get_case_document_order_callbacks_with_http_info(date = date, status = status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_document_order_callbacks_with_http_info( + date: Annotated[Optional[datetime], Field(description="Date for which fetch the Case Document Order Callback list. By default, the date will be set to current date.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of Document Order callbacks. Default status will fetch all callbacks.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page to fetch the Case Document Order Callback list.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseDocumentOrderCallbackListResponse]: + + """Get Case Document Order Callback list for a requested Date. + + Get Case Document Order Callback list for a requested Date. + + :param date: Date for which fetch the Case Document Order Callback list. By default, the date will be set to current date. + :type date: datetime + :param status: Status of Document Order callbacks. Default status will fetch all callbacks. + :type status: str + :param page_number: Page to fetch the Case Document Order Callback list.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocumentsApi(api_client).get_case_document_order_callbacks_with_http_info(date = date, status = status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_document_order_callbacks_without_preload_content( + date: Annotated[Optional[datetime], Field(description="Date for which fetch the Case Document Order Callback list. By default, the date will be set to current date.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of Document Order callbacks. Default status will fetch all callbacks.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page to fetch the Case Document Order Callback list.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Get Case Document Order Callback list for a requested Date. + + Get Case Document Order Callback list for a requested Date. + + :param date: Date for which fetch the Case Document Order Callback list. By default, the date will be set to current date. + :type date: datetime + :param status: Status of Document Order callbacks. Default status will fetch all callbacks. + :type status: str + :param page_number: Page to fetch the Case Document Order Callback list.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocumentsApi(api_client).get_case_document_order_callbacks( - **kwargs - ) + response = CaseDocumentsApi(api_client).get_case_document_order_callbacks_without_preload_content_with_http_info(date = date, status = status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_documents( - case_id, - **kwargs - ): - - """Gets Documents for a requested Case ID. - - - Gets Documents for a requested Case ID. + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Case ID for which you want the data for.")], + in_library: Annotated[Optional[StrictBool], Field(description="Filter all the documents those are added to the UniCourt library.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Get all the documents which were added to the case on or after a specific date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Sort all the documents based on the date when the document was added to the UniCourt Library.")] = None, + first_fetch_date: Annotated[Optional[datetime], Field(description="Sort all the documents based on the date it was fetched from the source site.")] = None, + sort_by: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=20)]], Field(description="Sort documents with document order.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page for which the result should be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseDocuments]: + + """Gets Documents for a requested Case ID. + + Gets Documents for a requested Case ID. + + :param case_id: Case ID for which you want the data for. (required) + :type case_id: str + :param in_library: Filter all the documents those are added to the UniCourt library. + :type in_library: bool + :param after_first_fetch_date: Get all the documents which were added to the case on or after a specific date. + :type after_first_fetch_date: datetime + :param library_date: Sort all the documents based on the date when the document was added to the UniCourt Library. + :type library_date: datetime + :param first_fetch_date: Sort all the documents based on the date it was fetched from the source site. + :type first_fetch_date: datetime + :param sort_by: Sort documents with document order. + :type sort_by: str + :param page_number: The page for which the result should be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocumentsApi(api_client).get_case_documents_with_http_info(case_id = case_id, in_library = in_library, after_first_fetch_date = after_first_fetch_date, library_date = library_date, first_fetch_date = first_fetch_date, sort_by = sort_by, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_documents_with_http_info( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Case ID for which you want the data for.")], + in_library: Annotated[Optional[StrictBool], Field(description="Filter all the documents those are added to the UniCourt library.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Get all the documents which were added to the case on or after a specific date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Sort all the documents based on the date when the document was added to the UniCourt Library.")] = None, + first_fetch_date: Annotated[Optional[datetime], Field(description="Sort all the documents based on the date it was fetched from the source site.")] = None, + sort_by: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=20)]], Field(description="Sort documents with document order.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page for which the result should be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseDocuments]: + + """Gets Documents for a requested Case ID. + + Gets Documents for a requested Case ID. + + :param case_id: Case ID for which you want the data for. (required) + :type case_id: str + :param in_library: Filter all the documents those are added to the UniCourt library. + :type in_library: bool + :param after_first_fetch_date: Get all the documents which were added to the case on or after a specific date. + :type after_first_fetch_date: datetime + :param library_date: Sort all the documents based on the date when the document was added to the UniCourt Library. + :type library_date: datetime + :param first_fetch_date: Sort all the documents based on the date it was fetched from the source site. + :type first_fetch_date: datetime + :param sort_by: Sort documents with document order. + :type sort_by: str + :param page_number: The page for which the result should be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocumentsApi(api_client).get_case_documents_with_http_info(case_id = case_id, in_library = in_library, after_first_fetch_date = after_first_fetch_date, library_date = library_date, first_fetch_date = first_fetch_date, sort_by = sort_by, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_documents_without_preload_content( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Case ID for which you want the data for.")], + in_library: Annotated[Optional[StrictBool], Field(description="Filter all the documents those are added to the UniCourt library.")] = None, + after_first_fetch_date: Annotated[Optional[datetime], Field(description="Get all the documents which were added to the case on or after a specific date.")] = None, + library_date: Annotated[Optional[datetime], Field(description="Sort all the documents based on the date when the document was added to the UniCourt Library.")] = None, + first_fetch_date: Annotated[Optional[datetime], Field(description="Sort all the documents based on the date it was fetched from the source site.")] = None, + sort_by: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=20)]], Field(description="Sort documents with document order.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page for which the result should be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets Documents for a requested Case ID. + + Gets Documents for a requested Case ID. + + :param case_id: Case ID for which you want the data for. (required) + :type case_id: str + :param in_library: Filter all the documents those are added to the UniCourt library. + :type in_library: bool + :param after_first_fetch_date: Get all the documents which were added to the case on or after a specific date. + :type after_first_fetch_date: datetime + :param library_date: Sort all the documents based on the date when the document was added to the UniCourt Library. + :type library_date: datetime + :param first_fetch_date: Sort all the documents based on the date it was fetched from the source site. + :type first_fetch_date: datetime + :param sort_by: Sort documents with document order. + :type sort_by: str + :param page_number: The page for which the result should be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocumentsApi(api_client).get_case_documents( - case_id, - **kwargs - ) + response = CaseDocumentsApi(api_client).get_case_documents_without_preload_content_with_http_info(case_id = case_id, in_library = in_library, after_first_fetch_date = after_first_fetch_date, library_date = library_date, first_fetch_date = first_fetch_date, sort_by = sort_by, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_document_by_id( - case_document_id, - **kwargs - ): - - """Gets details for a requested Document ID. - - - Gets details for a requested Document ID. + case_document_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Specific Case Dcoument ID for which you want the data for.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseDocument]: + + """Gets details for a requested Document ID. + + Gets details for a requested Document ID. + + :param case_document_id: Specific Case Dcoument ID for which you want the data for. (required) + :type case_document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocumentsApi(api_client).get_document_by_id_with_http_info(case_document_id = case_document_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_document_by_id_with_http_info( + case_document_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Specific Case Dcoument ID for which you want the data for.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseDocument]: + + """Gets details for a requested Document ID. + + Gets details for a requested Document ID. + + :param case_document_id: Specific Case Dcoument ID for which you want the data for. (required) + :type case_document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocumentsApi(api_client).get_document_by_id_with_http_info(case_document_id = case_document_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_document_by_id_without_preload_content( + case_document_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Specific Case Dcoument ID for which you want the data for.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets details for a requested Document ID. + + Gets details for a requested Document ID. + + :param case_document_id: Specific Case Dcoument ID for which you want the data for. (required) + :type case_document_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocumentsApi(api_client).get_document_by_id( - case_document_id, - **kwargs - ) + response = CaseDocumentsApi(api_client).get_document_by_id_without_preload_content_with_http_info(case_document_id = case_document_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def order_case_document( - **kwargs - ): - - """Add Case Document Order for requested Document Ids. - - - Add Case Document Order for requested Document Ids. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. + case_document_order_request: Annotated[Optional[CaseDocumentOrderRequest], Field(description="If the Case Document Order is for Preview, then the value for ``isPreviewOnly`` should be ``true`` else ``false``. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseDocumentOrderCallback]: + + """Add Case Document Order for requested Document Ids. + + Add Case Document Order for requested Document Ids. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. The progress of this Case Document Order request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_document_order_request: If the Case Document Order is for Preview, then the value for ``isPreviewOnly`` should be ``true`` else ``false``. + :type case_document_order_request: CaseDocumentOrderRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseDocumentsApi(api_client).order_case_document_with_http_info(case_document_order_request = case_document_order_request, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def order_case_document_with_http_info( + case_document_order_request: Annotated[Optional[CaseDocumentOrderRequest], Field(description="If the Case Document Order is for Preview, then the value for ``isPreviewOnly`` should be ``true`` else ``false``. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseDocumentOrderCallback]: + + """Add Case Document Order for requested Document Ids. + + Add Case Document Order for requested Document Ids. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. The progress of this Case Document Order request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_document_order_request: If the Case Document Order is for Preview, then the value for ``isPreviewOnly`` should be ``true`` else ``false``. + :type case_document_order_request: CaseDocumentOrderRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseDocumentsApi(api_client).order_case_document_with_http_info(case_document_order_request = case_document_order_request, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def order_case_document_without_preload_content( + case_document_order_request: Annotated[Optional[CaseDocumentOrderRequest], Field(description="If the Case Document Order is for Preview, then the value for ``isPreviewOnly`` should be ``true`` else ``false``. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Add Case Document Order for requested Document Ids. + + Add Case Document Order for requested Document Ids. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. The progress of this Case Document Order request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_document_order_request: If the Case Document Order is for Preview, then the value for ``isPreviewOnly`` should be ``true`` else ``false``. + :type case_document_order_request: CaseDocumentOrderRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseDocumentsApi(api_client).order_case_document( - **kwargs - ) + response = CaseDocumentsApi(api_client).order_case_document_without_preload_content_with_http_info(case_document_order_request = case_document_order_request, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/CaseExport.py b/unicourt/sdk/CaseExport.py index 5b308ef..769026b 100644 --- a/unicourt/sdk/CaseExport.py +++ b/unicourt/sdk/CaseExport.py @@ -1,64 +1,464 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from datetime import datetime +from pydantic import Field, field_validator +from typing import Optional +from typing_extensions import Annotated +from unicourt.model.case_export_callback import CaseExportCallback +from unicourt.model.case_export_callback_list_response import CaseExportCallbackListResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.case_export_api import CaseExportApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class CaseExport: @staticmethod def export_case( - case_id, - **kwargs - ): + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value of the case for which case export information is to be retrieved. The progress of this Case Export request is available via web socket messages documented on WebSocket Callbacks Documentation ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseExportCallback]: - """Gets case exported for a requested Case ID. + """Gets case exported for a requested Case ID. + Retrieve information about the specified case export. - Retrieve information about the specified case export. + :param case_id: The caseId value of the case for which case export information is to be retrieved. The progress of this Case Export request is available via web socket messages documented on WebSocket Callbacks Documentation (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseExportApi(api_client).export_case_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def export_case_with_http_info( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value of the case for which case export information is to be retrieved. The progress of this Case Export request is available via web socket messages documented on WebSocket Callbacks Documentation ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseExportCallback]: + + """Gets case exported for a requested Case ID. + + Retrieve information about the specified case export. + + :param case_id: The caseId value of the case for which case export information is to be retrieved. The progress of this Case Export request is available via web socket messages documented on WebSocket Callbacks Documentation (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseExportApi(api_client).export_case_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def export_case_without_preload_content( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value of the case for which case export information is to be retrieved. The progress of this Case Export request is available via web socket messages documented on WebSocket Callbacks Documentation ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets case exported for a requested Case ID. + + Retrieve information about the specified case export. + :param case_id: The caseId value of the case for which case export information is to be retrieved. The progress of this Case Export request is available via web socket messages documented on WebSocket Callbacks Documentation (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseExportApi(api_client).export_case( - case_id, - **kwargs - ) + response = CaseExportApi(api_client).export_case_without_preload_content_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_export_callback_by_id( - case_export_callback_id, - **kwargs - ): + case_export_callback_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseExportCallbackId value of the case export callback object to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseExportCallback]: + + """Get Case Export Callback for a requested Case Export Callback Id. + + Retrieve the specified case export callback object. + + :param case_export_callback_id: The caseExportCallbackId value of the case export callback object to be retrieved. (required) + :type case_export_callback_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseExportApi(api_client).get_case_export_callback_by_id_with_http_info(case_export_callback_id = case_export_callback_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def get_case_export_callback_by_id_with_http_info( + case_export_callback_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseExportCallbackId value of the case export callback object to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseExportCallback]: - """Get Case Export Callback for a requested Case Export Callback Id. + """Get Case Export Callback for a requested Case Export Callback Id. + Retrieve the specified case export callback object. - Retrieve the specified case export callback object. + :param case_export_callback_id: The caseExportCallbackId value of the case export callback object to be retrieved. (required) + :type case_export_callback_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseExportApi(api_client).get_case_export_callback_by_id_with_http_info(case_export_callback_id = case_export_callback_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def get_case_export_callback_by_id_without_preload_content( + case_export_callback_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseExportCallbackId value of the case export callback object to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + """Get Case Export Callback for a requested Case Export Callback Id. + Retrieve the specified case export callback object. + + :param case_export_callback_id: The caseExportCallbackId value of the case export callback object to be retrieved. (required) + :type case_export_callback_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseExportApi(api_client).get_case_export_callback_by_id( - case_export_callback_id, - **kwargs - ) + response = CaseExportApi(api_client).get_case_export_callback_by_id_without_preload_content_with_http_info(case_export_callback_id = case_export_callback_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_export_callbacks( - **kwargs - ): + date: Annotated[Optional[datetime], Field(description="The date for which callbacks are to be retrieved.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="The status code of the callbacks to be retrieved.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the callbacks to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseExportCallbackListResponse]: + + """Get Case Export Callback list for a requested Date. + + Retrieve callbacks according to the specified criteria. + + :param date: The date for which callbacks are to be retrieved. + :type date: datetime + :param status: The status code of the callbacks to be retrieved. + :type status: str + :param page_number: The page number of the callbacks to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseExportApi(api_client).get_case_export_callbacks_with_http_info(date = date, status = status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def get_case_export_callbacks_with_http_info( + date: Annotated[Optional[datetime], Field(description="The date for which callbacks are to be retrieved.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="The status code of the callbacks to be retrieved.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the callbacks to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseExportCallbackListResponse]: + + """Get Case Export Callback list for a requested Date. - """Get Case Export Callback list for a requested Date. + Retrieve callbacks according to the specified criteria. + :param date: The date for which callbacks are to be retrieved. + :type date: datetime + :param status: The status code of the callbacks to be retrieved. + :type status: str + :param page_number: The page number of the callbacks to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseExportApi(api_client).get_case_export_callbacks_with_http_info(date = date, status = status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def get_case_export_callbacks_without_preload_content( + date: Annotated[Optional[datetime], Field(description="The date for which callbacks are to be retrieved.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="The status code of the callbacks to be retrieved.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the callbacks to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - Retrieve callbacks according to the specified criteria. + """Get Case Export Callback list for a requested Date. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Retrieve callbacks according to the specified criteria. + :param date: The date for which callbacks are to be retrieved. + :type date: datetime + :param status: The status code of the callbacks to be retrieved. + :type status: str + :param page_number: The page number of the callbacks to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseExportApi(api_client).get_case_export_callbacks( - **kwargs - ) + response = CaseExportApi(api_client).get_case_export_callbacks_without_preload_content_with_http_info(date = date, status = status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/CaseSearch.py b/unicourt/sdk/CaseSearch.py index d6f20c9..1c1443f 100644 --- a/unicourt/sdk/CaseSearch.py +++ b/unicourt/sdk/CaseSearch.py @@ -1,45 +1,337 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from pydantic import Field, field_validator +from typing import Optional +from typing_extensions import Annotated +from unicourt.model.case_search_response import CaseSearchResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.case_search_api import CaseSearchApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class CaseSearch: @staticmethod def search_cases( - q, - **kwargs - ): + q: Annotated[str, Field(min_length=3, strict=True, max_length=2000, description="Query parameter for keyword expressions. ")], + sort: Annotated[Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]], Field(description="Query parameter specifying how results are to be sorted. Results can be sorted according to filedDate or relevancy.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Query parameter specifying whether search result are sorted in ascending or descending order.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseSearchResponse]: - """Case search. + """Case search. + This endpoint retrieves cases according to keyword expressions you provide.
Keyword expressions are constructed according to the rules described below.

This API supports multiple use cases: - Search for multiple keywords `Google OR Facebook`. - Search within particular attributes. - Relational search using terms and connectors. - And much more. ---- ## Allowed Connectors in Keyword Expressions | Connector | Description | Example | | ------| ------|------| | **AND** |Find cases containing each of the terms joined by AND connectors.|**personal AND injury**| | **OR** |Find cases containing any of the terms joined by OR connectors.|**order OR decision**| | **NOT** |Find cases that do not contain the specified term.|**personal AND NOT injury**. Find cases with the word “personal” and not “injury”.| | **“[phrase]”** |Find the exact phrase placed between the quotation marks.|**\"personal injury”**| | **~** |Find cases in which the specified words appear near each other. For example, \"personal injury\" ~ 5 targets cases in which the word \"personal\" appears within 5 words of the word \"injury\".|**“personal injury” ~ 5** - Find cases with “personal” within five words of “injury”. | | **( … )** |Specifies the order in which connectors are to be appliied in a keyword expression.| **personal AND (injury OR fall)** - Find cases with the word personal injury or personal fall.|

## Fields and Connectors Searching | Filed | Description | Example | | ------| ------|------| |**caseNumber** |Find cases with the specified case number (i.e., docket number).| **caseNumber:\"2020-L-007212\"** - Find cases whose case number matches given case number number.| |**caseName** |Find cases with the specified case title.| **caseName:\"THOMAS P. CARNEY, INC. VS BEHLER JAMES Et Al\"** - Find cases whose case name matches given terms.| |**Court**|Find cases in the specified court.|**(Court:(name:(New York)))** - Find cases in New York state.
| |**CaseStatus**|Find cases witih the specified case status.|**(CaseStatus:(name:Disposed))** - All disposed cases.
| |**CaseType**|Find cases of the specified case type. | **(CaseType:(name:Property))** - Cases with case type “property”.| |**Party** | Find cases involving the specified party.| **(Party:(name:Apple))** - Find cases involving Apple. | |**partyId**|Find cases involving a party with the specified partyId value.|**(Party:(partyId:\"PRTYgu1ffe866484c2\"))**| |**PartyRole** | Find cases in which at least one party has the specified party role. | **(Party:((PartyRole:(name:\"plaintiff\"))))** - Find cases with party role “plaintiff”.

**(Party:((PartyRole:(name:defendant)) AND (AttorneyRepresentationType:(name:(Attorney represented)))))** - Find cases where a party is acting as defendant and represented by an attorney.| |**AttorneyRepresentationType**| Find cases in which at least one party has the specified attorney representation type.|**(Party:(AttorneyRepresentationType:(name:\"attorney represented\")))** - Find cases where a party is represented by an attorney. | |**Attorney** | Find cases involving the specified attorney. | **(Attorney:(name:\"David Boies\"))** - Find cases involving the attorney David Boies. | |**AttorneyType**|Find cases involving at least one attorney of the specified attorney type.|**(Attorney:((AttorneyType:(name:\"Lead Attorney\"))))**| |**Judge** |Find cases involving the specified judge. | **(Judge:(name:\"Posner\"))** - Find cases involving Judge Posner.| |**JudgeType**|Find cases involving at least one judge of the specified judge type.|**(Judge:((JudgeType:(name:\"Magistrate\"))))**| |**CaseStats**|Find cases with the specified case statistics.|**(CaseStats:(partyCount:[10 TO 100]))** - Find cases involving 10 to 100 parties.
**(CaseStats:(attorneyCount:[2 TO 40]))** - Find cases involving 2 to 40 attorneys.
**(CaseStats:(judgeCount:[\\* TO 2]))** - Find cases involving up to 2 judges.
**(CaseStats:(docketEntryCount:[10 TO 100]))** - Find cases having 10 to 100 docket_entries.
**(CaseStats:(allCaseDocumentCount:[10 TO 100]))** - Find cases having 10 to 100 documents. | |**filedDate** | Find cases that were filed on the specified date or within the specified date range. | **filedDate:[2020-03-15 TO 2021-12-01]** - Find the most recently filed cases between March 15, 2020 and December 1, 2021 (inclusive). | |**lastFetchDate**| Find cases in which UniCourt last checked for updates on the specified date or within the specified date range. |**(lastFetchDate:[now-60d TO \\*\\])** - Find cases that were updated by UniCourt in the last 60 days. | |**lastFetchDateWithUpdates**|Find cases in which UniCourt last detected an update on the specified date or within the specified date range.|**(lastFetchDateWithUpdates:[now-6d TO \\*\\])** - Find cases for the changes found on court site in last 6 days.| |**participantsLastFetchDate**|Find cases in which information cocnerning participants was last updated on the specified date or within the specified date range.|**(participantsLastFetchDate:[now-6d TO \\*\\])** - Find cases where the participant's information was updated in last 6 days.| |**DocketEntry**|Find cases in which at least one docket entry contains the specified text.|**(DocketEntry:(text:(Motion to Compel Responses) AND docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00]))** - Find cases with docket text “Motion to Compel Responses” and action date between 2020-01-01 and 2020-05-01.| |**docketEntryDate**|Find cases in which at least one docket entry was made on the specified date or within the specified date range.|**(DocketEntry:(docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00])) AND (CaseStats:(allCaseDocumentCount:[0 TO 10]))** - Find cases with docket action date between 2020-01-01 and 2020-05-01 having up to 10 documents associated with it.| |**HearingDate**| Find cases with at least one hearing scheduled for the specified date or within the specified date range.|**(Hearing:(hearingDate:[now TO now+10d]))** - Find cases where hearing is scheduled in next 10 days.| |**HearingDate**| Search for cases where hearing is going to happen in 10 to 20days.|**(Hearing:(hearingDate:[now+10d TO now+20d]))** - Find cases where hearing is scheduled in next 10 to 20 days.| |**JurisdictionGeo**|Find cases in which the law of the specified state governs.|**(JurisdictionGeo:(state:\"New York\"))**- Find cases where Jurisdiction is New York state.| |**Party Address Exists**|Find cases with Party addresses.|**(Party:(Contact:(Address:(stateName:\\*))))**- Returns only those cases that have addresses for parties.| |**Document**|Find cases with specific document name and preview is available for the document.|**(CaseDocument:(name:\"civil case cover sheet\" AND isPreviewAvailable:true))**- Returns cases with document civil case cover sheet and preview is available.|

--- ## Party Sub Filter Examples |Example |Explanation | |---|---| |**(Party:(name:google AND (PartyRole:(name:\"plaintiff\"))))**|Find cases involving at least one plaintiff whose name contains the term \"Google\".| |**(Party:(name:\"OTELIA PEREIDA\" AND (AttorneyRepresentationType:(name:\"Attorney represented\")))) AND (Attorney:(name:\"Law Offices of Todd M Friedman\"))**|Find cases where the Party is *OTELIA PEREIDA* and is represented by the attorney *Law Offices of Todd M Friedman*.| --- ### All query parameters supported for this API can be found in below schema section. Schema --> CaseSearchQueryObject - This endpoint retrieves cases according to keyword expressions you provide.
Keyword expressions are constructed according to the rules described below.

This API supports multiple use cases: - Search for multiple keywords `Google OR Facebook`. - Search within particular attributes. - Relational search using terms and connectors. - And much more. ---- ## Allowed Connectors in Keyword Expressions | Connector | Description | Example | | ------| ------|------| | **AND** |Find cases containing each of the terms joined by AND connectors.|**personal AND injury**| | **OR** |Find cases containing any of the terms joined by OR connectors.|**order OR decision**| | **NOT** |Find cases that do not contain the specified term.|**personal AND NOT injury**. Find cases with the word “personal” and not “injury”.| | **“[phrase]”** |Find the exact phrase placed between the quotation marks.|**\"personal injury”**| | **~** |Find cases in which the specified words appear near each other. For example, \"personal injury\" ~ 5 targets cases in which the word \"personal\" appears within 5 words of the word \"injury\".|**“personal injury” ~ 5** - Find cases with “personal” within five words of “injury”. | | **( … )** |Specifies the order in which connectors are to be appliied in a keyword expression.| **personal AND (injury OR fall)** - Find cases with the word personal injury or personal fall.|

## Fields and Connectors Searching | Filed | Description | Example | | ------| ------|------| |**caseNumber** |Find cases with the specified case number (i.e., docket number).| **caseNumber:\"2020-L-007212\"** - Find cases whose case number matches given case number number.| |**caseName** |Find cases with the specified case title.| **caseName:\"THOMAS P. CARNEY, INC. VS BEHLER JAMES Et Al\"** - Find cases whose case name matches given terms.| |**Court**|Find cases in the specified court.|**(Court:(name:(New York)))** - Find cases in New York state.
| |**CaseStatus**|Find cases witih the specified case status.|**(CaseStatus:(name:Disposed))** - All disposed cases.
| |**CaseType**|Find cases of the specified case type. | **(CaseType:(name:Property))** - Cases with case type “property”.| |**Party** | Find cases involving the specified party.| **(Party:(name:Apple))** - Find cases involving Apple. | |**partyId**|Find cases involving a party with the specified partyId value.|**(Party:(partyId:\"PRTYgu1ffe866484c2\"))**| |**PartyRole** | Find cases in which at least one party has the specified party role. | **(Party:((PartyRole:(name:\"plaintiff\"))))** - Find cases with party role “plaintiff”.

**(Party:((PartyRole:(name:defendant)) AND (AttorneyRepresentationType:(name:(Attorney represented)))))** - Find cases where a party is acting as defendant and represented by an attorney.| |**AttorneyRepresentationType**| Find cases in which at least one party has the specified attorney representation type.|**(Party:(AttorneyRepresentationType:(name:\"attorney represented\")))** - Find cases where a party is represented by an attorney. | |**Attorney** | Find cases involving the specified attorney. | **(Attorney:(name:\"David Boies\"))** - Find cases involving the attorney David Boies. | |**AttorneyType**|Find cases involving at least one attorney of the specified attorney type.|**(Attorney:((AttorneyType:(name:\"Lead Attorney\"))))**| |**Judge** |Find cases involving the specified judge. | **(Judge:(name:\"Posner\"))** - Find cases involving Judge Posner.| |**JudgeType**|Find cases involving at least one judge of the specified judge type.|**(Judge:((JudgeType:(name:\"Magistrate\"))))**| |**CaseStats**|Find cases with the specified case statistics.|**(CaseStats:(partyCount:[10 TO 100]))** - Find cases involving 10 to 100 parties.
**(CaseStats:(attorneyCount:[2 TO 40]))** - Find cases involving 2 to 40 attorneys.
**(CaseStats:(judgeCount:[\\* TO 2]))** - Find cases involving up to 2 judges.
**(CaseStats:(docketEntryCount:[10 TO 100]))** - Find cases having 10 to 100 docket_entries.
**(CaseStats:(allCaseDocumentCount:[10 TO 100]))** - Find cases having 10 to 100 documents. | |**filedDate** | Find cases that were filed on the specified date or within the specified date range. | **filedDate:[2020-03-15T00:00:00 TO 2021-12-01T00:00:00]** - Find the most recently filed cases between March 15, 2020 and December 1, 2021 (inclusive). | |**lastFetchDate**| Find cases in which UniCourt last checked for updates on the specified date or within the specified date range. |**(lastFetchDate:[now-60d TO \\*\\])** - Find cases that were updated by UniCourt in the last 60 days. | |**lastFetchDateWithUpdates**|Find cases in which UniCourt last detected an update on the specified date or within the specified date range.|**(lastFetchDateWithUpdates:[now-6d TO \\*\\])** - Find cases for the changes found on court site in last 6 days.| |**participantsLastFetchDate**|Find cases in which information cocnerning participants was last updated on the specified date or within the specified date range.|**(participantsLastFetchDate:[now-6d TO \\*\\])** - Find cases where the participant's information was updated in last 6 days.| |**DocketEntry**|Find cases in which at least one docket entry contains the specified text.|**(DocketEntry:(text:(Motion to Compel Responses) AND docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00]))** - Find cases with docket text “Motion to Compel Responses” and action date between 2020-01-01 and 2020-05-01.| |**docketEntryDate**|Find cases in which at least one docket entry was made on the specified date or within the specified date range.|**(DocketEntry:(docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00])) AND (CaseStats:(allCaseDocumentCount:[0 TO 10]))** - Find cases with docket action date between 2020-01-01 and 2020-05-01 having up to 10 documents associated with it.| |**HearingDate**| Find cases with at least one hearing scheduled for the specified date or within the specified date range.|**(Hearing:(hearingDate:[now TO now+10d]))** - Find cases where hearing is scheduled in next 10 days.| |**HearingDate**| Search for cases where hearing is going to happen in 10 to 20days.|**(Hearing:(hearingDate:[now+10d TO now+20d]))** - Find cases where hearing is scheduled in next 10 to 20 days.| |**JurisdictionGeo**|Find cases in which the law of the specified state governs.|**(JurisdictionGeo:(state:\"New York\"))**- Find cases where Jurisdiction is New York state.| |**Party Address Exists**|Find cases with Party addresses.|**(Party:(Contact:(Address:(stateName:\\*))))**- Returns only those cases that have addresses for parties.| |**Document**|Find cases with specific document name and preview is available for the document.|**(CaseDocument:(name:\"civil case cover sheet\" AND isPreviewAvailable:true))**- Returns cases with document civil case cover sheet and preview is available.|

--- ## Party Sub Filter Examples |Example |Explanation | |---|---| |**(Party:(name:google AND (PartyRole:(name:\"plaintiff\"))))**|Find cases involving at least one plaintiff whose name contains the term \"Google\".| |**(Party:(name:\"OTELIA PEREIDA\" AND (AttorneyRepresentationType:(name:\"Attorney represented\")))) AND (Attorney:(name:\"Law Offices of Todd M Friedman\"))**|Find cases where the Party is *OTELIA PEREIDA* and is represented by the attorney *Law Offices of Todd M Friedman*.| --- ### All query parameters supported for this API can be found in below schema section. Schema --> CaseSearchQueryObject + :param q: Query parameter for keyword expressions. (required) + :type q: str + :param sort: Query parameter specifying how results are to be sorted. Results can be sorted according to filedDate or relevancy. + :type sort: str + :param order: Query parameter specifying whether search result are sorted in ascending or descending order. + :type order: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseSearchApi(api_client).search_cases_with_http_info(q = q, sort = sort, order = order, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def search_cases_with_http_info( + q: Annotated[str, Field(min_length=3, strict=True, max_length=2000, description="Query parameter for keyword expressions. ")], + sort: Annotated[Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]], Field(description="Query parameter specifying how results are to be sorted. Results can be sorted according to filedDate or relevancy.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Query parameter specifying whether search result are sorted in ascending or descending order.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseSearchResponse]: + + """Case search. + + This endpoint retrieves cases according to keyword expressions you provide.
Keyword expressions are constructed according to the rules described below.

This API supports multiple use cases: - Search for multiple keywords `Google OR Facebook`. - Search within particular attributes. - Relational search using terms and connectors. - And much more. ---- ## Allowed Connectors in Keyword Expressions | Connector | Description | Example | | ------| ------|------| | **AND** |Find cases containing each of the terms joined by AND connectors.|**personal AND injury**| | **OR** |Find cases containing any of the terms joined by OR connectors.|**order OR decision**| | **NOT** |Find cases that do not contain the specified term.|**personal AND NOT injury**. Find cases with the word “personal” and not “injury”.| | **“[phrase]”** |Find the exact phrase placed between the quotation marks.|**\"personal injury”**| | **~** |Find cases in which the specified words appear near each other. For example, \"personal injury\" ~ 5 targets cases in which the word \"personal\" appears within 5 words of the word \"injury\".|**“personal injury” ~ 5** - Find cases with “personal” within five words of “injury”. | | **( … )** |Specifies the order in which connectors are to be appliied in a keyword expression.| **personal AND (injury OR fall)** - Find cases with the word personal injury or personal fall.|

## Fields and Connectors Searching | Filed | Description | Example | | ------| ------|------| |**caseNumber** |Find cases with the specified case number (i.e., docket number).| **caseNumber:\"2020-L-007212\"** - Find cases whose case number matches given case number number.| |**caseName** |Find cases with the specified case title.| **caseName:\"THOMAS P. CARNEY, INC. VS BEHLER JAMES Et Al\"** - Find cases whose case name matches given terms.| |**Court**|Find cases in the specified court.|**(Court:(name:(New York)))** - Find cases in New York state.
| |**CaseStatus**|Find cases witih the specified case status.|**(CaseStatus:(name:Disposed))** - All disposed cases.
| |**CaseType**|Find cases of the specified case type. | **(CaseType:(name:Property))** - Cases with case type “property”.| |**Party** | Find cases involving the specified party.| **(Party:(name:Apple))** - Find cases involving Apple. | |**partyId**|Find cases involving a party with the specified partyId value.|**(Party:(partyId:\"PRTYgu1ffe866484c2\"))**| |**PartyRole** | Find cases in which at least one party has the specified party role. | **(Party:((PartyRole:(name:\"plaintiff\"))))** - Find cases with party role “plaintiff”.

**(Party:((PartyRole:(name:defendant)) AND (AttorneyRepresentationType:(name:(Attorney represented)))))** - Find cases where a party is acting as defendant and represented by an attorney.| |**AttorneyRepresentationType**| Find cases in which at least one party has the specified attorney representation type.|**(Party:(AttorneyRepresentationType:(name:\"attorney represented\")))** - Find cases where a party is represented by an attorney. | |**Attorney** | Find cases involving the specified attorney. | **(Attorney:(name:\"David Boies\"))** - Find cases involving the attorney David Boies. | |**AttorneyType**|Find cases involving at least one attorney of the specified attorney type.|**(Attorney:((AttorneyType:(name:\"Lead Attorney\"))))**| |**Judge** |Find cases involving the specified judge. | **(Judge:(name:\"Posner\"))** - Find cases involving Judge Posner.| |**JudgeType**|Find cases involving at least one judge of the specified judge type.|**(Judge:((JudgeType:(name:\"Magistrate\"))))**| |**CaseStats**|Find cases with the specified case statistics.|**(CaseStats:(partyCount:[10 TO 100]))** - Find cases involving 10 to 100 parties.
**(CaseStats:(attorneyCount:[2 TO 40]))** - Find cases involving 2 to 40 attorneys.
**(CaseStats:(judgeCount:[\\* TO 2]))** - Find cases involving up to 2 judges.
**(CaseStats:(docketEntryCount:[10 TO 100]))** - Find cases having 10 to 100 docket_entries.
**(CaseStats:(allCaseDocumentCount:[10 TO 100]))** - Find cases having 10 to 100 documents. | |**filedDate** | Find cases that were filed on the specified date or within the specified date range. | **filedDate:[2020-03-15 TO 2021-12-01]** - Find the most recently filed cases between March 15, 2020 and December 1, 2021 (inclusive). | |**lastFetchDate**| Find cases in which UniCourt last checked for updates on the specified date or within the specified date range. |**(lastFetchDate:[now-60d TO \\*\\])** - Find cases that were updated by UniCourt in the last 60 days. | |**lastFetchDateWithUpdates**|Find cases in which UniCourt last detected an update on the specified date or within the specified date range.|**(lastFetchDateWithUpdates:[now-6d TO \\*\\])** - Find cases for the changes found on court site in last 6 days.| |**participantsLastFetchDate**|Find cases in which information cocnerning participants was last updated on the specified date or within the specified date range.|**(participantsLastFetchDate:[now-6d TO \\*\\])** - Find cases where the participant's information was updated in last 6 days.| |**DocketEntry**|Find cases in which at least one docket entry contains the specified text.|**(DocketEntry:(text:(Motion to Compel Responses) AND docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00]))** - Find cases with docket text “Motion to Compel Responses” and action date between 2020-01-01 and 2020-05-01.| |**docketEntryDate**|Find cases in which at least one docket entry was made on the specified date or within the specified date range.|**(DocketEntry:(docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00])) AND (CaseStats:(allCaseDocumentCount:[0 TO 10]))** - Find cases with docket action date between 2020-01-01 and 2020-05-01 having up to 10 documents associated with it.| |**HearingDate**| Find cases with at least one hearing scheduled for the specified date or within the specified date range.|**(Hearing:(hearingDate:[now TO now+10d]))** - Find cases where hearing is scheduled in next 10 days.| |**HearingDate**| Search for cases where hearing is going to happen in 10 to 20days.|**(Hearing:(hearingDate:[now+10d TO now+20d]))** - Find cases where hearing is scheduled in next 10 to 20 days.| |**JurisdictionGeo**|Find cases in which the law of the specified state governs.|**(JurisdictionGeo:(state:\"New York\"))**- Find cases where Jurisdiction is New York state.| |**Party Address Exists**|Find cases with Party addresses.|**(Party:(Contact:(Address:(stateName:\\*))))**- Returns only those cases that have addresses for parties.| |**Document**|Find cases with specific document name and preview is available for the document.|**(CaseDocument:(name:\"civil case cover sheet\" AND isPreviewAvailable:true))**- Returns cases with document civil case cover sheet and preview is available.|

--- ## Party Sub Filter Examples |Example |Explanation | |---|---| |**(Party:(name:google AND (PartyRole:(name:\"plaintiff\"))))**|Find cases involving at least one plaintiff whose name contains the term \"Google\".| |**(Party:(name:\"OTELIA PEREIDA\" AND (AttorneyRepresentationType:(name:\"Attorney represented\")))) AND (Attorney:(name:\"Law Offices of Todd M Friedman\"))**|Find cases where the Party is *OTELIA PEREIDA* and is represented by the attorney *Law Offices of Todd M Friedman*.| --- ### All query parameters supported for this API can be found in below schema section. Schema --> CaseSearchQueryObject + + :param q: Query parameter for keyword expressions. (required) + :type q: str + :param sort: Query parameter specifying how results are to be sorted. Results can be sorted according to filedDate or relevancy. + :type sort: str + :param order: Query parameter specifying whether search result are sorted in ascending or descending order. + :type order: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseSearchApi(api_client).search_cases_with_http_info(q = q, sort = sort, order = order, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def search_cases_without_preload_content( + q: Annotated[str, Field(min_length=3, strict=True, max_length=2000, description="Query parameter for keyword expressions. ")], + sort: Annotated[Optional[Annotated[str, Field(min_length=9, strict=True, max_length=9)]], Field(description="Query parameter specifying how results are to be sorted. Results can be sorted according to filedDate or relevancy.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Query parameter specifying whether search result are sorted in ascending or descending order.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case search. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + This endpoint retrieves cases according to keyword expressions you provide.
Keyword expressions are constructed according to the rules described below.

This API supports multiple use cases: - Search for multiple keywords `Google OR Facebook`. - Search within particular attributes. - Relational search using terms and connectors. - And much more. ---- ## Allowed Connectors in Keyword Expressions | Connector | Description | Example | | ------| ------|------| | **AND** |Find cases containing each of the terms joined by AND connectors.|**personal AND injury**| | **OR** |Find cases containing any of the terms joined by OR connectors.|**order OR decision**| | **NOT** |Find cases that do not contain the specified term.|**personal AND NOT injury**. Find cases with the word “personal” and not “injury”.| | **“[phrase]”** |Find the exact phrase placed between the quotation marks.|**\"personal injury”**| | **~** |Find cases in which the specified words appear near each other. For example, \"personal injury\" ~ 5 targets cases in which the word \"personal\" appears within 5 words of the word \"injury\".|**“personal injury” ~ 5** - Find cases with “personal” within five words of “injury”. | | **( … )** |Specifies the order in which connectors are to be appliied in a keyword expression.| **personal AND (injury OR fall)** - Find cases with the word personal injury or personal fall.|

## Fields and Connectors Searching | Filed | Description | Example | | ------| ------|------| |**caseNumber** |Find cases with the specified case number (i.e., docket number).| **caseNumber:\"2020-L-007212\"** - Find cases whose case number matches given case number number.| |**caseName** |Find cases with the specified case title.| **caseName:\"THOMAS P. CARNEY, INC. VS BEHLER JAMES Et Al\"** - Find cases whose case name matches given terms.| |**Court**|Find cases in the specified court.|**(Court:(name:(New York)))** - Find cases in New York state.
| |**CaseStatus**|Find cases witih the specified case status.|**(CaseStatus:(name:Disposed))** - All disposed cases.
| |**CaseType**|Find cases of the specified case type. | **(CaseType:(name:Property))** - Cases with case type “property”.| |**Party** | Find cases involving the specified party.| **(Party:(name:Apple))** - Find cases involving Apple. | |**partyId**|Find cases involving a party with the specified partyId value.|**(Party:(partyId:\"PRTYgu1ffe866484c2\"))**| |**PartyRole** | Find cases in which at least one party has the specified party role. | **(Party:((PartyRole:(name:\"plaintiff\"))))** - Find cases with party role “plaintiff”.

**(Party:((PartyRole:(name:defendant)) AND (AttorneyRepresentationType:(name:(Attorney represented)))))** - Find cases where a party is acting as defendant and represented by an attorney.| |**AttorneyRepresentationType**| Find cases in which at least one party has the specified attorney representation type.|**(Party:(AttorneyRepresentationType:(name:\"attorney represented\")))** - Find cases where a party is represented by an attorney. | |**Attorney** | Find cases involving the specified attorney. | **(Attorney:(name:\"David Boies\"))** - Find cases involving the attorney David Boies. | |**AttorneyType**|Find cases involving at least one attorney of the specified attorney type.|**(Attorney:((AttorneyType:(name:\"Lead Attorney\"))))**| |**Judge** |Find cases involving the specified judge. | **(Judge:(name:\"Posner\"))** - Find cases involving Judge Posner.| |**JudgeType**|Find cases involving at least one judge of the specified judge type.|**(Judge:((JudgeType:(name:\"Magistrate\"))))**| |**CaseStats**|Find cases with the specified case statistics.|**(CaseStats:(partyCount:[10 TO 100]))** - Find cases involving 10 to 100 parties.
**(CaseStats:(attorneyCount:[2 TO 40]))** - Find cases involving 2 to 40 attorneys.
**(CaseStats:(judgeCount:[\\* TO 2]))** - Find cases involving up to 2 judges.
**(CaseStats:(docketEntryCount:[10 TO 100]))** - Find cases having 10 to 100 docket_entries.
**(CaseStats:(allCaseDocumentCount:[10 TO 100]))** - Find cases having 10 to 100 documents. | |**filedDate** | Find cases that were filed on the specified date or within the specified date range. | **filedDate:[2020-03-15 TO 2021-12-01]** - Find the most recently filed cases between March 15, 2020 and December 1, 2021 (inclusive). | |**lastFetchDate**| Find cases in which UniCourt last checked for updates on the specified date or within the specified date range. |**(lastFetchDate:[now-60d TO \\*\\])** - Find cases that were updated by UniCourt in the last 60 days. | |**lastFetchDateWithUpdates**|Find cases in which UniCourt last detected an update on the specified date or within the specified date range.|**(lastFetchDateWithUpdates:[now-6d TO \\*\\])** - Find cases for the changes found on court site in last 6 days.| |**participantsLastFetchDate**|Find cases in which information cocnerning participants was last updated on the specified date or within the specified date range.|**(participantsLastFetchDate:[now-6d TO \\*\\])** - Find cases where the participant's information was updated in last 6 days.| |**DocketEntry**|Find cases in which at least one docket entry contains the specified text.|**(DocketEntry:(text:(Motion to Compel Responses) AND docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00]))** - Find cases with docket text “Motion to Compel Responses” and action date between 2020-01-01 and 2020-05-01.| |**docketEntryDate**|Find cases in which at least one docket entry was made on the specified date or within the specified date range.|**(DocketEntry:(docketEntryDate:[2020-01-01T00:00:00 TO 2020-05-01T00:00:00])) AND (CaseStats:(allCaseDocumentCount:[0 TO 10]))** - Find cases with docket action date between 2020-01-01 and 2020-05-01 having up to 10 documents associated with it.| |**HearingDate**| Find cases with at least one hearing scheduled for the specified date or within the specified date range.|**(Hearing:(hearingDate:[now TO now+10d]))** - Find cases where hearing is scheduled in next 10 days.| |**HearingDate**| Search for cases where hearing is going to happen in 10 to 20days.|**(Hearing:(hearingDate:[now+10d TO now+20d]))** - Find cases where hearing is scheduled in next 10 to 20 days.| |**JurisdictionGeo**|Find cases in which the law of the specified state governs.|**(JurisdictionGeo:(state:\"New York\"))**- Find cases where Jurisdiction is New York state.| |**Party Address Exists**|Find cases with Party addresses.|**(Party:(Contact:(Address:(stateName:\\*))))**- Returns only those cases that have addresses for parties.| |**Document**|Find cases with specific document name and preview is available for the document.|**(CaseDocument:(name:\"civil case cover sheet\" AND isPreviewAvailable:true))**- Returns cases with document civil case cover sheet and preview is available.|

--- ## Party Sub Filter Examples |Example |Explanation | |---|---| |**(Party:(name:google AND (PartyRole:(name:\"plaintiff\"))))**|Find cases involving at least one plaintiff whose name contains the term \"Google\".| |**(Party:(name:\"OTELIA PEREIDA\" AND (AttorneyRepresentationType:(name:\"Attorney represented\")))) AND (Attorney:(name:\"Law Offices of Todd M Friedman\"))**|Find cases where the Party is *OTELIA PEREIDA* and is represented by the attorney *Law Offices of Todd M Friedman*.| --- ### All query parameters supported for this API can be found in below schema section. Schema --> CaseSearchQueryObject + :param q: Query parameter for keyword expressions. (required) + :type q: str + :param sort: Query parameter specifying how results are to be sorted. Results can be sorted according to filedDate or relevancy. + :type sort: str + :param order: Query parameter specifying whether search result are sorted in ascending or descending order. + :type order: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseSearchApi(api_client).search_cases( - q, - **kwargs - ) + response = CaseSearchApi(api_client).search_cases_without_preload_content_with_http_info(q = q, sort = sort, order = order, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def search_cases_by_id( - case_search_id, - **kwargs - ): + case_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Case Search information for the given caseSearchId.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseSearchResponse]: - """Case search results for a given caseSearchId. + """Case search results for a given caseSearchId. + Retrieve the search results corresponding to the specified caseSearchId value. + + :param case_search_id: Case Search information for the given caseSearchId. (required) + :type case_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseSearchApi(api_client).search_cases_by_id_with_http_info(case_search_id = case_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def search_cases_by_id_with_http_info( + case_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Case Search information for the given caseSearchId.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseSearchResponse]: + + """Case search results for a given caseSearchId. + + Retrieve the search results corresponding to the specified caseSearchId value. + + :param case_search_id: Case Search information for the given caseSearchId. (required) + :type case_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseSearchApi(api_client).search_cases_by_id_with_http_info(case_search_id = case_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def search_cases_by_id_without_preload_content( + case_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="Case Search information for the given caseSearchId.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - Retrieve the search results corresponding to the specified caseSearchId value. + """Case search results for a given caseSearchId. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Retrieve the search results corresponding to the specified caseSearchId value. + :param case_search_id: Case Search information for the given caseSearchId. (required) + :type case_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseSearchApi(api_client).search_cases_by_id( - case_search_id, - **kwargs - ) + response = CaseSearchApi(api_client).search_cases_by_id_without_preload_content_with_http_info(case_search_id = case_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/CaseTracking.py b/unicourt/sdk/CaseTracking.py index 40eb339..48be16c 100644 --- a/unicourt/sdk/CaseTracking.py +++ b/unicourt/sdk/CaseTracking.py @@ -1,83 +1,609 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from datetime import datetime +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated +from unicourt.model.case_track import CaseTrack +from unicourt.model.case_track_list_response import CaseTrackListResponse +from unicourt.model.case_track_request import CaseTrackRequest +from unicourt.model.success import Success +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.case_tracking_api import CaseTrackingApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class CaseTracking: @staticmethod def get_case_track_by_id( - case_id, - **kwargs - ): + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value for which case tracking information is to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseTrack]: - """Get Case Track for a requested Case Id. + """Get Case Track for a requested Case Id. + Retrieve case tracking information for the specified caseId value. - Retrieve case tracking information for the specified caseId value. + :param case_id: The caseId value for which case tracking information is to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseTrackingApi(api_client).get_case_track_by_id_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def get_case_track_by_id_with_http_info( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value for which case tracking information is to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseTrack]: + + """Get Case Track for a requested Case Id. + + Retrieve case tracking information for the specified caseId value. + + :param case_id: The caseId value for which case tracking information is to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseTrackingApi(api_client).get_case_track_by_id_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def get_case_track_by_id_without_preload_content( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value for which case tracking information is to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Get Case Track for a requested Case Id. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Retrieve case tracking information for the specified caseId value. + :param case_id: The caseId value for which case tracking information is to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseTrackingApi(api_client).get_case_track_by_id( - case_id, - **kwargs - ) + response = CaseTrackingApi(api_client).get_case_track_by_id_without_preload_content_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_tracks( - **kwargs - ): + last_fetch_date: Annotated[Optional[datetime], Field(description="The lastFetchDate value of the tracked case. The date value should be entered in the format YYYY-MM-DDTHH:MM:SS+ZZ:zz. ")] = None, + last_fetch_date_with_updates: Annotated[Optional[datetime], Field(description="The date on which changes were last found in the case information. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the results to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseTrackListResponse]: - """Get Case Track list. + """Get Case Track list. + Retrieve a list of all tracked cases. + + :param last_fetch_date: The lastFetchDate value of the tracked case. The date value should be entered in the format YYYY-MM-DDTHH:MM:SS+ZZ:zz. + :type last_fetch_date: datetime + :param last_fetch_date_with_updates: The date on which changes were last found in the case information. + :type last_fetch_date_with_updates: datetime + :param page_number: The page number of the results to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseTrackingApi(api_client).get_case_tracks_with_http_info(last_fetch_date = last_fetch_date, last_fetch_date_with_updates = last_fetch_date_with_updates, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def get_case_tracks_with_http_info( + last_fetch_date: Annotated[Optional[datetime], Field(description="The lastFetchDate value of the tracked case. The date value should be entered in the format YYYY-MM-DDTHH:MM:SS+ZZ:zz. ")] = None, + last_fetch_date_with_updates: Annotated[Optional[datetime], Field(description="The date on which changes were last found in the case information. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the results to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseTrackListResponse]: + + """Get Case Track list. + + Retrieve a list of all tracked cases. + + :param last_fetch_date: The lastFetchDate value of the tracked case. The date value should be entered in the format YYYY-MM-DDTHH:MM:SS+ZZ:zz. + :type last_fetch_date: datetime + :param last_fetch_date_with_updates: The date on which changes were last found in the case information. + :type last_fetch_date_with_updates: datetime + :param page_number: The page number of the results to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseTrackingApi(api_client).get_case_tracks_with_http_info(last_fetch_date = last_fetch_date, last_fetch_date_with_updates = last_fetch_date_with_updates, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def get_case_tracks_without_preload_content( + last_fetch_date: Annotated[Optional[datetime], Field(description="The lastFetchDate value of the tracked case. The date value should be entered in the format YYYY-MM-DDTHH:MM:SS+ZZ:zz. ")] = None, + last_fetch_date_with_updates: Annotated[Optional[datetime], Field(description="The date on which changes were last found in the case information. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the results to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - Retrieve a list of all tracked cases. + """Get Case Track list. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Retrieve a list of all tracked cases. + :param last_fetch_date: The lastFetchDate value of the tracked case. The date value should be entered in the format YYYY-MM-DDTHH:MM:SS+ZZ:zz. + :type last_fetch_date: datetime + :param last_fetch_date_with_updates: The date on which changes were last found in the case information. + :type last_fetch_date_with_updates: datetime + :param page_number: The page number of the results to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseTrackingApi(api_client).get_case_tracks( - **kwargs - ) + response = CaseTrackingApi(api_client).get_case_tracks_without_preload_content_with_http_info(last_fetch_date = last_fetch_date, last_fetch_date_with_updates = last_fetch_date_with_updates, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def remove_case_track_by_id( - case_id, - **kwargs - ): + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value for which case tracking information is to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[Success]: - """Remove Case Track for a specific Case Id. + """Remove Case Track for a specific Case Id. + Remove Case Track for a specific Case Id. - Remove Case Track for a specific Case Id. + :param case_id: The caseId value for which case tracking information is to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseTrackingApi(api_client).remove_case_track_by_id_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def remove_case_track_by_id_with_http_info( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value for which case tracking information is to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Success]: + + """Remove Case Track for a specific Case Id. + + Remove Case Track for a specific Case Id. + + :param case_id: The caseId value for which case tracking information is to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseTrackingApi(api_client).remove_case_track_by_id_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def remove_case_track_by_id_without_preload_content( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value for which case tracking information is to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Remove Case Track for a specific Case Id. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Remove Case Track for a specific Case Id. + :param case_id: The caseId value for which case tracking information is to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseTrackingApi(api_client).remove_case_track_by_id( - case_id, - **kwargs - ) + response = CaseTrackingApi(api_client).remove_case_track_by_id_without_preload_content_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def track_case( - **kwargs - ): + case_track_request: Optional[CaseTrackRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[Success]: - """Add Case Track for the requested Case Id. + """Add Case Track for the requested Case Id. + Track the specified case. The progress of this Case Track request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_track_request: + :type case_track_request: CaseTrackRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseTrackingApi(api_client).track_case_with_http_info(case_track_request = case_track_request, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def track_case_with_http_info( + case_track_request: Optional[CaseTrackRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Success]: + + """Add Case Track for the requested Case Id. + + Track the specified case. The progress of this Case Track request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_track_request: + :type case_track_request: CaseTrackRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseTrackingApi(api_client).track_case_with_http_info(case_track_request = case_track_request, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def track_case_without_preload_content( + case_track_request: Optional[CaseTrackRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - Track the specified case. + """Add Case Track for the requested Case Id. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Track the specified case. The progress of this Case Track request is available via web socket messages documented on WebSocket Callbacks Documentation + :param case_track_request: + :type case_track_request: CaseTrackRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseTrackingApi(api_client).track_case( - **kwargs - ) + response = CaseTrackingApi(api_client).track_case_without_preload_content_with_http_info(case_track_request = case_track_request, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/CaseUpdate.py b/unicourt/sdk/CaseUpdate.py index e860c07..467c25e 100644 --- a/unicourt/sdk/CaseUpdate.py +++ b/unicourt/sdk/CaseUpdate.py @@ -1,62 +1,474 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from datetime import datetime +from pydantic import Field, field_validator +from typing import Optional +from typing_extensions import Annotated +from unicourt.model.case_update import CaseUpdate +from unicourt.model.case_update_list_response import CaseUpdateListResponse +from unicourt.model.case_update_request import CaseUpdateRequest +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.case_update_api import CaseUpdateApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class CaseUpdate: @staticmethod def get_case_update_by_case_id( - case_id, - **kwargs - ): + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value of the case object for which updates are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseUpdate]: - """Get Case Updates for a requested CaseId. + """Get Case Updates for a requested CaseId. + Retrieve case updates for the specified case object. - Retrieve case updates for the specified case object. + :param case_id: The caseId value of the case object for which updates are to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseUpdateApi(api_client).get_case_update_by_case_id_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def get_case_update_by_case_id_with_http_info( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value of the case object for which updates are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseUpdate]: + + """Get Case Updates for a requested CaseId. + + Retrieve case updates for the specified case object. + + :param case_id: The caseId value of the case object for which updates are to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseUpdateApi(api_client).get_case_update_by_case_id_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_update_by_case_id_without_preload_content( + case_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseId value of the case object for which updates are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Get Case Updates for a requested CaseId. + + Retrieve case updates for the specified case object. + :param case_id: The caseId value of the case object for which updates are to be retrieved. (required) + :type case_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseUpdateApi(api_client).get_case_update_by_case_id( - case_id, - **kwargs - ) + response = CaseUpdateApi(api_client).get_case_update_by_case_id_without_preload_content_with_http_info(case_id = case_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_updates( - **kwargs - ): + case_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="The caseId value of the case for which updates should be retrieved.")] = None, + requested_date: Annotated[Optional[datetime], Field(description="The date for which case updates are to be retrieved.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of the case updates to be retrieved.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the callbacks to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseUpdateListResponse]: + + """Get Case Update list for a requested Date. + + Retrieve case updates for the specified date. + + :param case_id: The caseId value of the case for which updates should be retrieved. + :type case_id: str + :param requested_date: The date for which case updates are to be retrieved. + :type requested_date: datetime + :param status: Status of the case updates to be retrieved. + :type status: str + :param page_number: The page number of the callbacks to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseUpdateApi(api_client).get_case_updates_with_http_info(case_id = case_id, requested_date = requested_date, status = status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def get_case_updates_with_http_info( + case_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="The caseId value of the case for which updates should be retrieved.")] = None, + requested_date: Annotated[Optional[datetime], Field(description="The date for which case updates are to be retrieved.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of the case updates to be retrieved.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the callbacks to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseUpdateListResponse]: - """Get Case Update list for a requested Date. + """Get Case Update list for a requested Date. + Retrieve case updates for the specified date. - Retrieve case updates for the specified date. + :param case_id: The caseId value of the case for which updates should be retrieved. + :type case_id: str + :param requested_date: The date for which case updates are to be retrieved. + :type requested_date: datetime + :param status: Status of the case updates to be retrieved. + :type status: str + :param page_number: The page number of the callbacks to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseUpdateApi(api_client).get_case_updates_with_http_info(case_id = case_id, requested_date = requested_date, status = status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def get_case_updates_without_preload_content( + case_id: Annotated[Optional[Annotated[str, Field(min_length=18, strict=True, max_length=18)]], Field(description="The caseId value of the case for which updates should be retrieved.")] = None, + requested_date: Annotated[Optional[datetime], Field(description="The date for which case updates are to be retrieved.")] = None, + status: Annotated[Optional[Annotated[str, Field(min_length=7, strict=True, max_length=11)]], Field(description="Status of the case updates to be retrieved.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the callbacks to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + """Get Case Update list for a requested Date. + Retrieve case updates for the specified date. + + :param case_id: The caseId value of the case for which updates should be retrieved. + :type case_id: str + :param requested_date: The date for which case updates are to be retrieved. + :type requested_date: datetime + :param status: Status of the case updates to be retrieved. + :type status: str + :param page_number: The page number of the callbacks to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseUpdateApi(api_client).get_case_updates( - **kwargs - ) + response = CaseUpdateApi(api_client).get_case_updates_without_preload_content_with_http_info(case_id = case_id, requested_date = requested_date, status = status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def update_case( - **kwargs - ): + case_update_request: Optional[CaseUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseUpdate]: + + """Add Case Update for the requested Case Id. + + Request case updates for the specified case. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. The progress of this Case Update request is available via web socket messages documented on WebSocket Callbacks Documentation + + :param case_update_request: + :type case_update_request: CaseUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CaseUpdateApi(api_client).update_case_with_http_info(case_update_request = case_update_request, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def update_case_with_http_info( + case_update_request: Optional[CaseUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseUpdate]: + + """Add Case Update for the requested Case Id. - """Add Case Update for the requested Case Id. + Request case updates for the specified case. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. The progress of this Case Update request is available via web socket messages documented on WebSocket Callbacks Documentation + :param case_update_request: + :type case_update_request: CaseUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CaseUpdateApi(api_client).update_case_with_http_info(case_update_request = case_update_request, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def update_case_without_preload_content( + case_update_request: Optional[CaseUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - Request case updates for the specified case. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. + """Add Case Update for the requested Case Id. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Request case updates for the specified case. The status will be ``IN_PROGRESS`` after it has been requested. If the request is not processed within 4 hours, it will be reported as ``DELAYED``. If the request is still incomplete after 4 hours, it will remain in the DELAYED status for up to 72 hours after the request was approved. Such requests will be recorded as ``TIMEOUT`` after 72 hours. The progress of this Case Update request is available via web socket messages documented on WebSocket Callbacks Documentation + :param case_update_request: + :type case_update_request: CaseUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CaseUpdateApi(api_client).update_case( - **kwargs - ) + response = CaseUpdateApi(api_client).update_case_without_preload_content_with_http_info(case_update_request = case_update_request, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/CourtAvailability.py b/unicourt/sdk/CourtAvailability.py index ff3bff7..e36884f 100644 --- a/unicourt/sdk/CourtAvailability.py +++ b/unicourt/sdk/CourtAvailability.py @@ -1,24 +1,157 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from pydantic import Field +from typing_extensions import Annotated +from unicourt.model.court_coverage import CourtCoverage +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.court_availability_api import CourtAvailabilityApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class CourtAvailability: @staticmethod def get_court_coverage( - court_id, - **kwargs - ): + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CourtCoverage]: - """Gets Court Coverage of all courts of specific type. + """Gets Court Coverage of all courts of specific type. + Determine whether the specified court is covered by UniCourt. - Determine whether the specified court is covered by UniCourt. + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtAvailabilityApi(api_client).get_court_coverage_with_http_info(court_id = court_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def get_court_coverage_with_http_info( + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtCoverage]: + + """Gets Court Coverage of all courts of specific type. + + Determine whether the specified court is covered by UniCourt. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtAvailabilityApi(api_client).get_court_coverage_with_http_info(court_id = court_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def get_court_coverage_without_preload_content( + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Gets Court Coverage of all courts of specific type. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Determine whether the specified court is covered by UniCourt. + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtAvailabilityApi(api_client).get_court_coverage( - court_id, - **kwargs - ) + response = CourtAvailabilityApi(api_client).get_court_coverage_without_preload_content_with_http_info(court_id = court_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/CourtStandards.py b/unicourt/sdk/CourtStandards.py index 8aa3f3d..798891d 100644 --- a/unicourt/sdk/CourtStandards.py +++ b/unicourt/sdk/CourtStandards.py @@ -1,1148 +1,9054 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from unicourt.model.area_of_law import AreaOfLaw +from unicourt.model.area_of_law_response import AreaOfLawResponse +from unicourt.model.attorney_representation_type import AttorneyRepresentationType +from unicourt.model.attorney_representation_type_response import AttorneyRepresentationTypeResponse +from unicourt.model.attorney_type import AttorneyType +from unicourt.model.attorney_type_response import AttorneyTypeResponse +from unicourt.model.case_class import CaseClass +from unicourt.model.case_class_response import CaseClassResponse +from unicourt.model.case_relationship_type import CaseRelationshipType +from unicourt.model.case_relationship_type_response import CaseRelationshipTypeResponse +from unicourt.model.case_status import CaseStatus +from unicourt.model.case_status_group import CaseStatusGroup +from unicourt.model.case_status_group_response import CaseStatusGroupResponse +from unicourt.model.case_status_response import CaseStatusResponse +from unicourt.model.case_type import CaseType +from unicourt.model.case_type_group import CaseTypeGroup +from unicourt.model.case_type_group_response import CaseTypeGroupResponse +from unicourt.model.case_type_response import CaseTypeResponse +from unicourt.model.cause_of_action import CauseOfAction +from unicourt.model.cause_of_action_additional_data import CauseOfActionAdditionalData +from unicourt.model.cause_of_action_additional_data_response import CauseOfActionAdditionalDataResponse +from unicourt.model.cause_of_action_group import CauseOfActionGroup +from unicourt.model.cause_of_action_group_response import CauseOfActionGroupResponse +from unicourt.model.cause_of_action_response import CauseOfActionResponse +from unicourt.model.charge import Charge +from unicourt.model.charge_additional_data import ChargeAdditionalData +from unicourt.model.charge_additional_data_response import ChargeAdditionalDataResponse +from unicourt.model.charge_degree import ChargeDegree +from unicourt.model.charge_degree_response import ChargeDegreeResponse +from unicourt.model.charge_group import ChargeGroup +from unicourt.model.charge_group_response import ChargeGroupResponse +from unicourt.model.charge_response import ChargeResponse +from unicourt.model.charge_severity import ChargeSeverity +from unicourt.model.charge_severity_response import ChargeSeverityResponse +from unicourt.model.court import Court +from unicourt.model.court_location import CourtLocation +from unicourt.model.court_location_response import CourtLocationResponse +from unicourt.model.court_response import CourtResponse +from unicourt.model.court_service_status import CourtServiceStatus +from unicourt.model.court_service_status_response import CourtServiceStatusResponse +from unicourt.model.court_system import CourtSystem +from unicourt.model.court_system_response import CourtSystemResponse +from unicourt.model.court_type import CourtType +from unicourt.model.court_type_response import CourtTypeResponse +from unicourt.model.judge_type import JudgeType +from unicourt.model.judge_type_response import JudgeTypeResponse +from unicourt.model.jurisdiction_geo import JurisdictionGeo +from unicourt.model.jurisdiction_geo_response import JurisdictionGeoResponse +from unicourt.model.party_role import PartyRole +from unicourt.model.party_role_group import PartyRoleGroup +from unicourt.model.party_role_group_response import PartyRoleGroupResponse +from unicourt.model.party_role_response import PartyRoleResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.court_standards_api import CourtStandardsApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class CourtStandards: @staticmethod def get_appeal_courts_for_court( - court_id, - **kwargs - ): - - """Appeal Court Objects for given courtId. - - - Retrieve the appeals courts associated with the specified court. + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CourtResponse]: + + """Appeal Court Objects for given courtId. + + Retrieve the appeals courts associated with the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_appeal_courts_for_court_with_http_info(court_id = court_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_appeal_courts_for_court_with_http_info( + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtResponse]: + + """Appeal Court Objects for given courtId. + + Retrieve the appeals courts associated with the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_appeal_courts_for_court_with_http_info(court_id = court_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_appeal_courts_for_court_without_preload_content( + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Appeal Court Objects for given courtId. + + Retrieve the appeals courts associated with the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_appeal_courts_for_court( - court_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_appeal_courts_for_court_without_preload_content_with_http_info(court_id = court_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_area_of_law( - area_of_law_id, - **kwargs - ): - - """AreaOfLaw Object for the given AreaOfLaw Id. - - - Retrieve the specified area of law. + area_of_law_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The areaOfLawId value of the desired area of law.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AreaOfLaw]: + + """AreaOfLaw Object for the given AreaOfLaw Id. + + Retrieve the specified area of law. + + :param area_of_law_id: The areaOfLawId value of the desired area of law. (required) + :type area_of_law_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_area_of_law_with_http_info(area_of_law_id = area_of_law_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_area_of_law_with_http_info( + area_of_law_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The areaOfLawId value of the desired area of law.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AreaOfLaw]: + + """AreaOfLaw Object for the given AreaOfLaw Id. + + Retrieve the specified area of law. + + :param area_of_law_id: The areaOfLawId value of the desired area of law. (required) + :type area_of_law_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_area_of_law_with_http_info(area_of_law_id = area_of_law_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_area_of_law_without_preload_content( + area_of_law_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The areaOfLawId value of the desired area of law.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """AreaOfLaw Object for the given AreaOfLaw Id. + + Retrieve the specified area of law. + + :param area_of_law_id: The areaOfLawId value of the desired area of law. (required) + :type area_of_law_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_area_of_law( - area_of_law_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_area_of_law_without_preload_content_with_http_info(area_of_law_id = area_of_law_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_areas_of_law( - **kwargs - ): - - """AreaOfLaw Object. - - - The keyword expression targeting the desired area of law. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> AreaOfLawQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more areas of law using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AreaOfLawResponse]: + + """AreaOfLaw Object. + + The keyword expression targeting the desired area of law. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> AreaOfLawQueryObject + + :param q: Retrieve one or more areas of law using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_areas_of_law_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_areas_of_law_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more areas of law using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AreaOfLawResponse]: + + """AreaOfLaw Object. + + The keyword expression targeting the desired area of law. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> AreaOfLawQueryObject + + :param q: Retrieve one or more areas of law using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_areas_of_law_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_areas_of_law_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more areas of law using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """AreaOfLaw Object. + + The keyword expression targeting the desired area of law. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> AreaOfLawQueryObject + + :param q: Retrieve one or more areas of law using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_areas_of_law( - **kwargs - ) + response = CourtStandardsApi(api_client).get_areas_of_law_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_attorney_representation_type( - attorney_representation_type_id, - **kwargs - ): - - """Attorney Representation Type Object for the given attorneyRepresentationTypeId. - - - Retrieve the specified attorney representation type. + attorney_representation_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The attorneyRepresentationTypeId value of the desired attorney representation type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AttorneyRepresentationType]: + + """Attorney Representation Type Object for the given attorneyRepresentationTypeId. + + Retrieve the specified attorney representation type. + + :param attorney_representation_type_id: The attorneyRepresentationTypeId value of the desired attorney representation type. (required) + :type attorney_representation_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_attorney_representation_type_with_http_info(attorney_representation_type_id = attorney_representation_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_attorney_representation_type_with_http_info( + attorney_representation_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The attorneyRepresentationTypeId value of the desired attorney representation type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AttorneyRepresentationType]: + + """Attorney Representation Type Object for the given attorneyRepresentationTypeId. + + Retrieve the specified attorney representation type. + + :param attorney_representation_type_id: The attorneyRepresentationTypeId value of the desired attorney representation type. (required) + :type attorney_representation_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_attorney_representation_type_with_http_info(attorney_representation_type_id = attorney_representation_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_attorney_representation_type_without_preload_content( + attorney_representation_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The attorneyRepresentationTypeId value of the desired attorney representation type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Attorney Representation Type Object for the given attorneyRepresentationTypeId. + + Retrieve the specified attorney representation type. + + :param attorney_representation_type_id: The attorneyRepresentationTypeId value of the desired attorney representation type. (required) + :type attorney_representation_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_attorney_representation_type( - attorney_representation_type_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_attorney_representation_type_without_preload_content_with_http_info(attorney_representation_type_id = attorney_representation_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_attorney_representation_types( - **kwargs - ): - - """Attorney Representation Type Object. - - - Retrieve an attorney representation type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyRepresentationTypeQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the attorney representation type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AttorneyRepresentationTypeResponse]: + + """Attorney Representation Type Object. + + Retrieve an attorney representation type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyRepresentationTypeQueryObject + + :param q: The keyword expression targeting the attorney representation type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_attorney_representation_types_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_attorney_representation_types_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the attorney representation type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AttorneyRepresentationTypeResponse]: + + """Attorney Representation Type Object. + + Retrieve an attorney representation type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyRepresentationTypeQueryObject + + :param q: The keyword expression targeting the attorney representation type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_attorney_representation_types_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_attorney_representation_types_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the attorney representation type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Attorney Representation Type Object. + + Retrieve an attorney representation type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyRepresentationTypeQueryObject + + :param q: The keyword expression targeting the attorney representation type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_attorney_representation_types( - **kwargs - ) + response = CourtStandardsApi(api_client).get_attorney_representation_types_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_attorney_type( - attorney_type_id, - **kwargs - ): - - """Attorney Type Object for given Attorney Type Id. - - - Retrieve a specified attorney type object. + attorney_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The attorneyTypeId value of the desired attorney type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AttorneyType]: + + """Attorney Type Object for given Attorney Type Id. + + Retrieve a specified attorney type object. + + :param attorney_type_id: The attorneyTypeId value of the desired attorney type. (required) + :type attorney_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_attorney_type_with_http_info(attorney_type_id = attorney_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_attorney_type_with_http_info( + attorney_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The attorneyTypeId value of the desired attorney type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AttorneyType]: + + """Attorney Type Object for given Attorney Type Id. + + Retrieve a specified attorney type object. + + :param attorney_type_id: The attorneyTypeId value of the desired attorney type. (required) + :type attorney_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_attorney_type_with_http_info(attorney_type_id = attorney_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_attorney_type_without_preload_content( + attorney_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The attorneyTypeId value of the desired attorney type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Attorney Type Object for given Attorney Type Id. + + Retrieve a specified attorney type object. + + :param attorney_type_id: The attorneyTypeId value of the desired attorney type. (required) + :type attorney_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_attorney_type( - attorney_type_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_attorney_type_without_preload_content_with_http_info(attorney_type_id = attorney_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_attorney_types( - **kwargs - ): - - """Attorney Type Object. - - - Retrieve an attorney type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyTypeQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the attorney type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AttorneyTypeResponse]: + + """Attorney Type Object. + + Retrieve an attorney type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyTypeQueryObject + + :param q: The keyword expression targeting the attorney type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_attorney_types_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_attorney_types_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the attorney type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AttorneyTypeResponse]: + + """Attorney Type Object. + + Retrieve an attorney type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyTypeQueryObject + + :param q: The keyword expression targeting the attorney type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_attorney_types_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_attorney_types_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the attorney type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Attorney Type Object. + + Retrieve an attorney type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> AttorneyTypeQueryObject + + :param q: The keyword expression targeting the attorney type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_attorney_types( - **kwargs - ) + response = CourtStandardsApi(api_client).get_attorney_types_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_class( - case_class_id, - **kwargs - ): - - """Case Class Object for the given Case Class Id. - - - Retrieve the specified case class. + case_class_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseClassId value of the desired case class.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseClass]: + + """Case Class Object for the given Case Class Id. + + Retrieve the specified case class. + + :param case_class_id: The caseClassId value of the desired case class. (required) + :type case_class_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_case_class_with_http_info(case_class_id = case_class_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_class_with_http_info( + case_class_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseClassId value of the desired case class.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseClass]: + + """Case Class Object for the given Case Class Id. + + Retrieve the specified case class. + + :param case_class_id: The caseClassId value of the desired case class. (required) + :type case_class_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_case_class_with_http_info(case_class_id = case_class_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_class_without_preload_content( + case_class_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseClassId value of the desired case class.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Class Object for the given Case Class Id. + + Retrieve the specified case class. + + :param case_class_id: The caseClassId value of the desired case class. (required) + :type case_class_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_case_class( - case_class_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_case_class_without_preload_content_with_http_info(case_class_id = case_class_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_relationship_type( - case_relationship_type_id, - **kwargs - ): - - """Case Relationship Type Object for the given caseRelationshipTypeId. - - - Retrieve the specified case relationship type. + case_relationship_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseRelationshipTypeId value of the desired case relationship type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseRelationshipType]: + + """Case Relationship Type Object for the given caseRelationshipTypeId. + + Retrieve the specified case relationship type. + + :param case_relationship_type_id: The caseRelationshipTypeId value of the desired case relationship type. (required) + :type case_relationship_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_case_relationship_type_with_http_info(case_relationship_type_id = case_relationship_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_relationship_type_with_http_info( + case_relationship_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseRelationshipTypeId value of the desired case relationship type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseRelationshipType]: + + """Case Relationship Type Object for the given caseRelationshipTypeId. + + Retrieve the specified case relationship type. + + :param case_relationship_type_id: The caseRelationshipTypeId value of the desired case relationship type. (required) + :type case_relationship_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_case_relationship_type_with_http_info(case_relationship_type_id = case_relationship_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_relationship_type_without_preload_content( + case_relationship_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseRelationshipTypeId value of the desired case relationship type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Relationship Type Object for the given caseRelationshipTypeId. + + Retrieve the specified case relationship type. + + :param case_relationship_type_id: The caseRelationshipTypeId value of the desired case relationship type. (required) + :type case_relationship_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_case_relationship_type( - case_relationship_type_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_case_relationship_type_without_preload_content_with_http_info(case_relationship_type_id = case_relationship_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_relationship_types( - **kwargs - ): - - """Case Relationship Type Object. - - - Retrieve an case relationship type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseRelationshipTypeQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the case relationship type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseRelationshipTypeResponse]: + + """Case Relationship Type Object. + + Retrieve an case relationship type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseRelationshipTypeQueryObject + + :param q: The keyword expression targeting the case relationship type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_case_relationship_types_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_relationship_types_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the case relationship type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseRelationshipTypeResponse]: + + """Case Relationship Type Object. + + Retrieve an case relationship type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseRelationshipTypeQueryObject + + :param q: The keyword expression targeting the case relationship type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_case_relationship_types_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_relationship_types_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the case relationship type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Relationship Type Object. + + Retrieve an case relationship type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseRelationshipTypeQueryObject + + :param q: The keyword expression targeting the case relationship type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_case_relationship_types( - **kwargs - ) + response = CourtStandardsApi(api_client).get_case_relationship_types_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_status( - case_status_id, - **kwargs - ): - - """Returns the caseStatus information for the given caseStatusId. - - - Retrieve the specified case status. + case_status_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseStatusId value of the desired case status.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseStatus]: + + """Returns the caseStatus information for the given caseStatusId. + + Retrieve the specified case status. + + :param case_status_id: The caseStatusId value of the desired case status. (required) + :type case_status_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_case_status_with_http_info(case_status_id = case_status_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_status_with_http_info( + case_status_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseStatusId value of the desired case status.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseStatus]: + + """Returns the caseStatus information for the given caseStatusId. + + Retrieve the specified case status. + + :param case_status_id: The caseStatusId value of the desired case status. (required) + :type case_status_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_case_status_with_http_info(case_status_id = case_status_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_status_without_preload_content( + case_status_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseStatusId value of the desired case status.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Returns the caseStatus information for the given caseStatusId. + + Retrieve the specified case status. + + :param case_status_id: The caseStatusId value of the desired case status. (required) + :type case_status_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_case_status( - case_status_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_case_status_without_preload_content_with_http_info(case_status_id = case_status_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_status_group( - case_status_group_id, - **kwargs - ): - - """Returns the caseStatusGroup information for the given caseStatusGroupId. - - - Retrieve the specified case status group. + case_status_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseStatusGroupId value of the desired case status group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseStatusGroup]: + + """Returns the caseStatusGroup information for the given caseStatusGroupId. + + Retrieve the specified case status group. + + :param case_status_group_id: The caseStatusGroupId value of the desired case status group. (required) + :type case_status_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_case_status_group_with_http_info(case_status_group_id = case_status_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_status_group_with_http_info( + case_status_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseStatusGroupId value of the desired case status group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseStatusGroup]: + + """Returns the caseStatusGroup information for the given caseStatusGroupId. + + Retrieve the specified case status group. + + :param case_status_group_id: The caseStatusGroupId value of the desired case status group. (required) + :type case_status_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_case_status_group_with_http_info(case_status_group_id = case_status_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_status_group_without_preload_content( + case_status_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseStatusGroupId value of the desired case status group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Returns the caseStatusGroup information for the given caseStatusGroupId. + + Retrieve the specified case status group. + + :param case_status_group_id: The caseStatusGroupId value of the desired case status group. (required) + :type case_status_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_case_status_group( - case_status_group_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_case_status_group_without_preload_content_with_http_info(case_status_group_id = case_status_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_status_groups( - **kwargs - ): - - """Case Status Group Object. - - - Retrieve a case status group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseStatusGroupQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case status group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseStatusGroupResponse]: + + """Case Status Group Object. + + Retrieve a case status group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseStatusGroupQueryObject + + :param q: The keyword expression targeting the desired case status group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_case_status_groups_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_status_groups_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case status group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseStatusGroupResponse]: + + """Case Status Group Object. + + Retrieve a case status group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseStatusGroupQueryObject + + :param q: The keyword expression targeting the desired case status group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_case_status_groups_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_status_groups_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case status group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Status Group Object. + + Retrieve a case status group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseStatusGroupQueryObject + + :param q: The keyword expression targeting the desired case status group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_case_status_groups( - **kwargs - ) + response = CourtStandardsApi(api_client).get_case_status_groups_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_type( - case_type_id, - **kwargs - ): - - """CaseType Object for given Case Type Id. - - - Retrieve the specified case type. + case_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseTypeId value of the desired case type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseType]: + + """CaseType Object for given Case Type Id. + + Retrieve the specified case type. + + :param case_type_id: The caseTypeId value of the desired case type. (required) + :type case_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_case_type_with_http_info(case_type_id = case_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_type_with_http_info( + case_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseTypeId value of the desired case type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseType]: + + """CaseType Object for given Case Type Id. + + Retrieve the specified case type. + + :param case_type_id: The caseTypeId value of the desired case type. (required) + :type case_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_case_type_with_http_info(case_type_id = case_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_type_without_preload_content( + case_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The caseTypeId value of the desired case type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """CaseType Object for given Case Type Id. + + Retrieve the specified case type. + + :param case_type_id: The caseTypeId value of the desired case type. (required) + :type case_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_case_type( - case_type_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_case_type_without_preload_content_with_http_info(case_type_id = case_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_type_group( - case_type_group_id, - **kwargs - ): - - """CaseType Group for the given CaseType Group Id. - - - Retrieve the specified case type group. + case_type_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="caseTypeGroupId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseTypeGroup]: + + """CaseType Group for the given CaseType Group Id. + + Retrieve the specified case type group. + + :param case_type_group_id: caseTypeGroupId (required) + :type case_type_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_case_type_group_with_http_info(case_type_group_id = case_type_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_type_group_with_http_info( + case_type_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="caseTypeGroupId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseTypeGroup]: + + """CaseType Group for the given CaseType Group Id. + + Retrieve the specified case type group. + + :param case_type_group_id: caseTypeGroupId (required) + :type case_type_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_case_type_group_with_http_info(case_type_group_id = case_type_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_type_group_without_preload_content( + case_type_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="caseTypeGroupId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """CaseType Group for the given CaseType Group Id. + + Retrieve the specified case type group. + + :param case_type_group_id: caseTypeGroupId (required) + :type case_type_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_case_type_group( - case_type_group_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_case_type_group_without_preload_content_with_http_info(case_type_group_id = case_type_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_type_groups( - **kwargs - ): - - """CaseTypeGroup Object. - - - Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeGroupQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseTypeGroupResponse]: + + """CaseTypeGroup Object. + + Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeGroupQueryObject + + :param q: Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_case_type_groups_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_type_groups_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseTypeGroupResponse]: + + """CaseTypeGroup Object. + + Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeGroupQueryObject + + :param q: Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_case_type_groups_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_type_groups_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """CaseTypeGroup Object. + + Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeGroupQueryObject + + :param q: Retrieve one or more case type groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_case_type_groups( - **kwargs - ) + response = CourtStandardsApi(api_client).get_case_type_groups_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_case_types( - **kwargs - ): - - """Case Type Object. - - - Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseTypeResponse]: + + """Case Type Object. + + Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeQueryObject + + :param q: Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_case_types_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_case_types_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseTypeResponse]: + + """Case Type Object. + + Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeQueryObject + + :param q: Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_case_types_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_case_types_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Type Object. + + Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseTypeQueryObject + + :param q: Retrieve one or more case types using a keyword expression. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_case_types( - **kwargs - ) + response = CourtStandardsApi(api_client).get_case_types_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_cases_class( - **kwargs - ): - - """Case Class Object. - - - Retrieve one or more case classes using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseClassQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case class. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseClassResponse]: + + """Case Class Object. + + Retrieve one or more case classes using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseClassQueryObject + + :param q: The keyword expression targeting the desired case class. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_cases_class_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_cases_class_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case class. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseClassResponse]: + + """Case Class Object. + + Retrieve one or more case classes using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseClassQueryObject + + :param q: The keyword expression targeting the desired case class. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_cases_class_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_cases_class_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case class. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Class Object. + + Retrieve one or more case classes using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CaseClassQueryObject + + :param q: The keyword expression targeting the desired case class. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_cases_class( - **kwargs - ) + response = CourtStandardsApi(api_client).get_cases_class_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_cases_status( - **kwargs - ): - - """Case Status Object. - - - Retrieve a case status using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> CaseStatusQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case status. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CaseStatusResponse]: + + """Case Status Object. + + Retrieve a case status using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> CaseStatusQueryObject + + :param q: The keyword expression targeting the desired case status. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_cases_status_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_cases_status_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case status. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CaseStatusResponse]: + + """Case Status Object. + + Retrieve a case status using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> CaseStatusQueryObject + + :param q: The keyword expression targeting the desired case status. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_cases_status_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_cases_status_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired case status. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Case Status Object. + + Retrieve a case status using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below Schema section. Schema --> CaseStatusQueryObject + + :param q: The keyword expression targeting the desired case status. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_cases_status( - **kwargs - ) + response = CourtStandardsApi(api_client).get_cases_status_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_cause_of_action( - cause_of_action_id, - **kwargs - ): - - """CauseOfAction Object for the given causeOfActionId. - - - Retrieve the specified cause of action. + cause_of_action_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The causeOfActionId value of the desired cause of action.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CauseOfAction]: + + """CauseOfAction Object for the given causeOfActionId. + + Retrieve the specified cause of action. + + :param cause_of_action_id: The causeOfActionId value of the desired cause of action. (required) + :type cause_of_action_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_cause_of_action_with_http_info(cause_of_action_id = cause_of_action_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_cause_of_action_with_http_info( + cause_of_action_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The causeOfActionId value of the desired cause of action.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CauseOfAction]: + + """CauseOfAction Object for the given causeOfActionId. + + Retrieve the specified cause of action. + + :param cause_of_action_id: The causeOfActionId value of the desired cause of action. (required) + :type cause_of_action_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_cause_of_action_with_http_info(cause_of_action_id = cause_of_action_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_cause_of_action_without_preload_content( + cause_of_action_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The causeOfActionId value of the desired cause of action.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """CauseOfAction Object for the given causeOfActionId. + + Retrieve the specified cause of action. + + :param cause_of_action_id: The causeOfActionId value of the desired cause of action. (required) + :type cause_of_action_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_cause_of_action( - cause_of_action_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_cause_of_action_without_preload_content_with_http_info(cause_of_action_id = cause_of_action_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_cause_of_action_additional_data( - cause_of_action_additional_data_id, - **kwargs - ): - - """CauseOfActionAdditionalData Object for the given causeOfActionAdditionalDataId. - - - Retrieve the specified cause of action additional data. + cause_of_action_additional_data_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The causeOfActionAdditionalDataId value of the desired cause of action additional data.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CauseOfActionAdditionalData]: + + """CauseOfActionAdditionalData Object for the given causeOfActionAdditionalDataId. + + Retrieve the specified cause of action additional data. + + :param cause_of_action_additional_data_id: The causeOfActionAdditionalDataId value of the desired cause of action additional data. (required) + :type cause_of_action_additional_data_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_cause_of_action_additional_data_with_http_info(cause_of_action_additional_data_id = cause_of_action_additional_data_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_cause_of_action_additional_data_with_http_info( + cause_of_action_additional_data_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The causeOfActionAdditionalDataId value of the desired cause of action additional data.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CauseOfActionAdditionalData]: + + """CauseOfActionAdditionalData Object for the given causeOfActionAdditionalDataId. + + Retrieve the specified cause of action additional data. + + :param cause_of_action_additional_data_id: The causeOfActionAdditionalDataId value of the desired cause of action additional data. (required) + :type cause_of_action_additional_data_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_cause_of_action_additional_data_with_http_info(cause_of_action_additional_data_id = cause_of_action_additional_data_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_cause_of_action_additional_data_without_preload_content( + cause_of_action_additional_data_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The causeOfActionAdditionalDataId value of the desired cause of action additional data.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """CauseOfActionAdditionalData Object for the given causeOfActionAdditionalDataId. + + Retrieve the specified cause of action additional data. + + :param cause_of_action_additional_data_id: The causeOfActionAdditionalDataId value of the desired cause of action additional data. (required) + :type cause_of_action_additional_data_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_cause_of_action_additional_data( - cause_of_action_additional_data_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_cause_of_action_additional_data_without_preload_content_with_http_info(cause_of_action_additional_data_id = cause_of_action_additional_data_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_cause_of_action_group( - cause_of_action_group_id, - **kwargs - ): - - """CauseOfActionGroup Object for the given causeOfActionGroupId. - - - Retrieve the specified cause of action group. + cause_of_action_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="causeOfActionGroupId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CauseOfActionGroup]: + + """CauseOfActionGroup Object for the given causeOfActionGroupId. + + Retrieve the specified cause of action group. + + :param cause_of_action_group_id: causeOfActionGroupId (required) + :type cause_of_action_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_cause_of_action_group_with_http_info(cause_of_action_group_id = cause_of_action_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_cause_of_action_group_with_http_info( + cause_of_action_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="causeOfActionGroupId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CauseOfActionGroup]: + + """CauseOfActionGroup Object for the given causeOfActionGroupId. + + Retrieve the specified cause of action group. + + :param cause_of_action_group_id: causeOfActionGroupId (required) + :type cause_of_action_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_cause_of_action_group_with_http_info(cause_of_action_group_id = cause_of_action_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_cause_of_action_group_without_preload_content( + cause_of_action_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="causeOfActionGroupId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """CauseOfActionGroup Object for the given causeOfActionGroupId. + + Retrieve the specified cause of action group. + + :param cause_of_action_group_id: causeOfActionGroupId (required) + :type cause_of_action_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_cause_of_action_group( - cause_of_action_group_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_cause_of_action_group_without_preload_content_with_http_info(cause_of_action_group_id = cause_of_action_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_causes_of_action( - **kwargs - ): - - """CauseOfAction Object. - - - Retrieve a cause of action using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CauseOfActionResponse]: + + """CauseOfAction Object. + + Retrieve a cause of action using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionQueryObject + + :param q: The keyword expression targeting the desired cause of action. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_causes_of_action_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_causes_of_action_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CauseOfActionResponse]: + + """CauseOfAction Object. + + Retrieve a cause of action using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionQueryObject + + :param q: The keyword expression targeting the desired cause of action. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_causes_of_action_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_causes_of_action_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """CauseOfAction Object. + + Retrieve a cause of action using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionQueryObject + + :param q: The keyword expression targeting the desired cause of action. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_causes_of_action( - **kwargs - ) + response = CourtStandardsApi(api_client).get_causes_of_action_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_causes_of_action_additional_data( - **kwargs - ): - - """CauseOfActionAdditionaData Object. - - - Retrieve a cause of action additional data using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionAdditionalDataQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action additional data. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CauseOfActionAdditionalDataResponse]: + + """CauseOfActionAdditionaData Object. + + Retrieve a cause of action additional data using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionAdditionalDataQueryObject + + :param q: The keyword expression targeting the desired cause of action additional data. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_causes_of_action_additional_data_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_causes_of_action_additional_data_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action additional data. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CauseOfActionAdditionalDataResponse]: + + """CauseOfActionAdditionaData Object. + + Retrieve a cause of action additional data using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionAdditionalDataQueryObject + + :param q: The keyword expression targeting the desired cause of action additional data. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_causes_of_action_additional_data_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_causes_of_action_additional_data_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action additional data. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """CauseOfActionAdditionaData Object. + + Retrieve a cause of action additional data using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionAdditionalDataQueryObject + + :param q: The keyword expression targeting the desired cause of action additional data. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_causes_of_action_additional_data( - **kwargs - ) + response = CourtStandardsApi(api_client).get_causes_of_action_additional_data_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_causes_of_action_group( - **kwargs - ): - - """CauseOfActionGroup Object. - - - Retrieve a cause of action group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionGroupQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CauseOfActionGroupResponse]: + + """CauseOfActionGroup Object. + + Retrieve a cause of action group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionGroupQueryObject + + :param q: The keyword expression targeting the desired cause of action group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_causes_of_action_group_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_causes_of_action_group_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CauseOfActionGroupResponse]: + + """CauseOfActionGroup Object. + + Retrieve a cause of action group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionGroupQueryObject + + :param q: The keyword expression targeting the desired cause of action group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_causes_of_action_group_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_causes_of_action_group_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired cause of action group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """CauseOfActionGroup Object. + + Retrieve a cause of action group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CauseOfActionGroupQueryObject + + :param q: The keyword expression targeting the desired cause of action group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_causes_of_action_group( - **kwargs - ) + response = CourtStandardsApi(api_client).get_causes_of_action_group_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_charge( - charge_id, - **kwargs - ): - - """Charge Object for the given chargeId. - - - Retrieve the specified charge. + charge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeId value of the desired charge.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[Charge]: + + """Charge Object for the given chargeId. + + Retrieve the specified charge. + + :param charge_id: The chargeId value of the desired charge. (required) + :type charge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_charge_with_http_info(charge_id = charge_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_charge_with_http_info( + charge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeId value of the desired charge.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Charge]: + + """Charge Object for the given chargeId. + + Retrieve the specified charge. + + :param charge_id: The chargeId value of the desired charge. (required) + :type charge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_charge_with_http_info(charge_id = charge_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_charge_without_preload_content( + charge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeId value of the desired charge.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Charge Object for the given chargeId. + + Retrieve the specified charge. + + :param charge_id: The chargeId value of the desired charge. (required) + :type charge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_charge( - charge_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_charge_without_preload_content_with_http_info(charge_id = charge_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_charge_additional_data( - charge_additional_data_id, - **kwargs - ): - - """Charge Additional Data Object for the given chargeAdditionalDataId. - - - Retrieve the specified charge additional data. + charge_additional_data_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeAdditionalDataId value of the desired charge additional data.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[ChargeAdditionalData]: + + """Charge Additional Data Object for the given chargeAdditionalDataId. + + Retrieve the specified charge additional data. + + :param charge_additional_data_id: The chargeAdditionalDataId value of the desired charge additional data. (required) + :type charge_additional_data_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_charge_additional_data_with_http_info(charge_additional_data_id = charge_additional_data_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_charge_additional_data_with_http_info( + charge_additional_data_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeAdditionalDataId value of the desired charge additional data.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeAdditionalData]: + + """Charge Additional Data Object for the given chargeAdditionalDataId. + + Retrieve the specified charge additional data. + + :param charge_additional_data_id: The chargeAdditionalDataId value of the desired charge additional data. (required) + :type charge_additional_data_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_charge_additional_data_with_http_info(charge_additional_data_id = charge_additional_data_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_charge_additional_data_without_preload_content( + charge_additional_data_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeAdditionalDataId value of the desired charge additional data.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Charge Additional Data Object for the given chargeAdditionalDataId. + + Retrieve the specified charge additional data. + + :param charge_additional_data_id: The chargeAdditionalDataId value of the desired charge additional data. (required) + :type charge_additional_data_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_charge_additional_data( - charge_additional_data_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_charge_additional_data_without_preload_content_with_http_info(charge_additional_data_id = charge_additional_data_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_charge_degree( - charge_degree_id, - **kwargs - ): - - """ChargeDegree Object for the given chargeDegreeId. - - - Retrieve the specified charge degree. + charge_degree_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeDegreeId value of the desired charge degree.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[ChargeDegree]: + + """ChargeDegree Object for the given chargeDegreeId. + + Retrieve the specified charge degree. + + :param charge_degree_id: The chargeDegreeId value of the desired charge degree. (required) + :type charge_degree_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_charge_degree_with_http_info(charge_degree_id = charge_degree_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_charge_degree_with_http_info( + charge_degree_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeDegreeId value of the desired charge degree.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeDegree]: + + """ChargeDegree Object for the given chargeDegreeId. + + Retrieve the specified charge degree. + + :param charge_degree_id: The chargeDegreeId value of the desired charge degree. (required) + :type charge_degree_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_charge_degree_with_http_info(charge_degree_id = charge_degree_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_charge_degree_without_preload_content( + charge_degree_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeDegreeId value of the desired charge degree.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """ChargeDegree Object for the given chargeDegreeId. + + Retrieve the specified charge degree. + + :param charge_degree_id: The chargeDegreeId value of the desired charge degree. (required) + :type charge_degree_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_charge_degree( - charge_degree_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_charge_degree_without_preload_content_with_http_info(charge_degree_id = charge_degree_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_charge_group( - charge_group_id, - **kwargs - ): - - """Charge Group Object for the given chargeGroupId. - - - Retrieve the specified charge group. + charge_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeGroupId value of the desired charge group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[ChargeGroup]: + + """Charge Group Object for the given chargeGroupId. + + Retrieve the specified charge group. + + :param charge_group_id: The chargeGroupId value of the desired charge group. (required) + :type charge_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_charge_group_with_http_info(charge_group_id = charge_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_charge_group_with_http_info( + charge_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeGroupId value of the desired charge group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeGroup]: + + """Charge Group Object for the given chargeGroupId. + + Retrieve the specified charge group. + + :param charge_group_id: The chargeGroupId value of the desired charge group. (required) + :type charge_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_charge_group_with_http_info(charge_group_id = charge_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_charge_group_without_preload_content( + charge_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeGroupId value of the desired charge group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Charge Group Object for the given chargeGroupId. + + Retrieve the specified charge group. + + :param charge_group_id: The chargeGroupId value of the desired charge group. (required) + :type charge_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_charge_group( - charge_group_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_charge_group_without_preload_content_with_http_info(charge_group_id = charge_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_charge_groups( - **kwargs - ): - - """Charge Group Object. - - - Retrieve one or more charge groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeGroupQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[ChargeGroupResponse]: + + """Charge Group Object. + + Retrieve one or more charge groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeGroupQueryObject + + :param q: The keyword expression targeting the desired charge group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_charge_groups_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_charge_groups_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeGroupResponse]: + + """Charge Group Object. + + Retrieve one or more charge groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeGroupQueryObject + + :param q: The keyword expression targeting the desired charge group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_charge_groups_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_charge_groups_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Charge Group Object. + + Retrieve one or more charge groups using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeGroupQueryObject + + :param q: The keyword expression targeting the desired charge group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_charge_groups( - **kwargs - ) + response = CourtStandardsApi(api_client).get_charge_groups_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_charge_severity( - charge_severity_id, - **kwargs - ): - - """ChargeSeverity Object for the given chargeSeverityId. - - - Retrieve the specified charge severity. + charge_severity_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeSeverityId value of the desired charge severity.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[ChargeSeverity]: + + """ChargeSeverity Object for the given chargeSeverityId. + + Retrieve the specified charge severity. + + :param charge_severity_id: The chargeSeverityId value of the desired charge severity. (required) + :type charge_severity_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_charge_severity_with_http_info(charge_severity_id = charge_severity_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_charge_severity_with_http_info( + charge_severity_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeSeverityId value of the desired charge severity.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeSeverity]: + + """ChargeSeverity Object for the given chargeSeverityId. + + Retrieve the specified charge severity. + + :param charge_severity_id: The chargeSeverityId value of the desired charge severity. (required) + :type charge_severity_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_charge_severity_with_http_info(charge_severity_id = charge_severity_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_charge_severity_without_preload_content( + charge_severity_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The chargeSeverityId value of the desired charge severity.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """ChargeSeverity Object for the given chargeSeverityId. + + Retrieve the specified charge severity. + + :param charge_severity_id: The chargeSeverityId value of the desired charge severity. (required) + :type charge_severity_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_charge_severity( - charge_severity_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_charge_severity_without_preload_content_with_http_info(charge_severity_id = charge_severity_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_charges( - **kwargs - ): - - """Charge Object. - - - Retrieve one or more charges using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[ChargeResponse]: + + """Charge Object. + + Retrieve one or more charges using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeQueryObject + + :param q: The keyword expression targeting the desired charge. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_charges_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_charges_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeResponse]: + + """Charge Object. + + Retrieve one or more charges using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeQueryObject + + :param q: The keyword expression targeting the desired charge. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_charges_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_charges_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Charge Object. + + Retrieve one or more charges using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeQueryObject + + :param q: The keyword expression targeting the desired charge. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_charges( - **kwargs - ) + response = CourtStandardsApi(api_client).get_charges_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_charges_additional_data( - **kwargs - ): - - """Charge Additional Data Object. - - - Retrieve additional information on a charge using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeAdditionalDataQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge additional data. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[ChargeAdditionalDataResponse]: + + """Charge Additional Data Object. + + Retrieve additional information on a charge using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeAdditionalDataQueryObject + + :param q: The keyword expression targeting the desired charge additional data. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_charges_additional_data_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_charges_additional_data_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge additional data. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeAdditionalDataResponse]: + + """Charge Additional Data Object. + + Retrieve additional information on a charge using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeAdditionalDataQueryObject + + :param q: The keyword expression targeting the desired charge additional data. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_charges_additional_data_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_charges_additional_data_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge additional data. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Charge Additional Data Object. + + Retrieve additional information on a charge using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeAdditionalDataQueryObject + + :param q: The keyword expression targeting the desired charge additional data. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_charges_additional_data( - **kwargs - ) + response = CourtStandardsApi(api_client).get_charges_additional_data_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_charges_degree( - **kwargs - ): - - """ChargeDegree Object. - - - Retrieve a charge degree using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeDegreeQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge degree. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[ChargeDegreeResponse]: + + """ChargeDegree Object. + + Retrieve a charge degree using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeDegreeQueryObject + + :param q: The keyword expression targeting the desired charge degree. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_charges_degree_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_charges_degree_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge degree. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeDegreeResponse]: + + """ChargeDegree Object. + + Retrieve a charge degree using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeDegreeQueryObject + + :param q: The keyword expression targeting the desired charge degree. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_charges_degree_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_charges_degree_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge degree. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """ChargeDegree Object. + + Retrieve a charge degree using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeDegreeQueryObject + + :param q: The keyword expression targeting the desired charge degree. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_charges_degree( - **kwargs - ) + response = CourtStandardsApi(api_client).get_charges_degree_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_charges_severity( - **kwargs - ): - - """ChargeSeverity Object. - - - Retrieve a charge severity using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeSeverityQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge severity. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[ChargeSeverityResponse]: + + """ChargeSeverity Object. + + Retrieve a charge severity using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeSeverityQueryObject + + :param q: The keyword expression targeting the desired charge severity. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_charges_severity_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_charges_severity_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge severity. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ChargeSeverityResponse]: + + """ChargeSeverity Object. + + Retrieve a charge severity using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeSeverityQueryObject + + :param q: The keyword expression targeting the desired charge severity. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_charges_severity_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_charges_severity_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired charge severity. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """ChargeSeverity Object. + + Retrieve a charge severity using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> ChargeSeverityQueryObject + + :param q: The keyword expression targeting the desired charge severity. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_charges_severity( - **kwargs - ) + response = CourtStandardsApi(api_client).get_charges_severity_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_court( - court_id, - **kwargs - ): - - """Court Object for given courtId. - - - Retrieve information about a specified court. + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[Court]: + + """Court Object for given courtId. + + Retrieve information about a specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_court_with_http_info(court_id = court_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_court_with_http_info( + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Court]: + + """Court Object for given courtId. + + Retrieve information about a specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_court_with_http_info(court_id = court_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_court_without_preload_content( + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Court Object for given courtId. + + Retrieve information about a specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_court( - court_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_court_without_preload_content_with_http_info(court_id = court_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_court_location( - court_location_id, - **kwargs - ): - - """Courthouse Object for given Court Location Id. - - - Contains the Court Location Object. + court_location_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="courtLocationId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CourtLocation]: + + """Courthouse Object for given Court Location Id. + + Contains the Court Location Object. + + :param court_location_id: courtLocationId (required) + :type court_location_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_court_location_with_http_info(court_location_id = court_location_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_court_location_with_http_info( + court_location_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="courtLocationId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtLocation]: + + """Courthouse Object for given Court Location Id. + + Contains the Court Location Object. + + :param court_location_id: courtLocationId (required) + :type court_location_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_court_location_with_http_info(court_location_id = court_location_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_court_location_without_preload_content( + court_location_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="courtLocationId")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Courthouse Object for given Court Location Id. + + Contains the Court Location Object. + + :param court_location_id: courtLocationId (required) + :type court_location_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_court_location( - court_location_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_court_location_without_preload_content_with_http_info(court_location_id = court_location_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_court_locations( - **kwargs - ): - - """Courthouse Object. - - - Retrieve the specified court location or court locations. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtLocationQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court location or court locations to target. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CourtLocationResponse]: + + """Courthouse Object. + + Retrieve the specified court location or court locations. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtLocationQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court location or court locations to target. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_court_locations_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_court_locations_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court location or court locations to target. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtLocationResponse]: + + """Courthouse Object. + + Retrieve the specified court location or court locations. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtLocationQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court location or court locations to target. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_court_locations_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_court_locations_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court location or court locations to target. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Courthouse Object. + + Retrieve the specified court location or court locations. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtLocationQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court location or court locations to target. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_court_locations( - **kwargs - ) + response = CourtStandardsApi(api_client).get_court_locations_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_court_locations_for_court( - court_id, - **kwargs - ): - - """Associated Court Location for given courtId. - - - Retrieve the court locations associated with the specified court. + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CourtLocationResponse]: + + """Associated Court Location for given courtId. + + Retrieve the court locations associated with the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_court_locations_for_court_with_http_info(court_id = court_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_court_locations_for_court_with_http_info( + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtLocationResponse]: + + """Associated Court Location for given courtId. + + Retrieve the court locations associated with the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_court_locations_for_court_with_http_info(court_id = court_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_court_locations_for_court_without_preload_content( + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Associated Court Location for given courtId. + + Retrieve the court locations associated with the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_court_locations_for_court( - court_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_court_locations_for_court_without_preload_content_with_http_info(court_id = court_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_court_service_status( - court_service_status_id, - **kwargs - ): - - """Court Service Status Object for the given courtServiceStatusId. - - - Retrieve the court status of the specified court. + court_service_status_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtServiceStatusId value of the desired court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CourtServiceStatus]: + + """Court Service Status Object for the given courtServiceStatusId. + + Retrieve the court status of the specified court. + + :param court_service_status_id: The courtServiceStatusId value of the desired court. (required) + :type court_service_status_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_court_service_status_with_http_info(court_service_status_id = court_service_status_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_court_service_status_with_http_info( + court_service_status_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtServiceStatusId value of the desired court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtServiceStatus]: + + """Court Service Status Object for the given courtServiceStatusId. + + Retrieve the court status of the specified court. + + :param court_service_status_id: The courtServiceStatusId value of the desired court. (required) + :type court_service_status_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_court_service_status_with_http_info(court_service_status_id = court_service_status_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_court_service_status_without_preload_content( + court_service_status_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtServiceStatusId value of the desired court.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Court Service Status Object for the given courtServiceStatusId. + + Retrieve the court status of the specified court. + + :param court_service_status_id: The courtServiceStatusId value of the desired court. (required) + :type court_service_status_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_court_service_status( - court_service_status_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_court_service_status_without_preload_content_with_http_info(court_service_status_id = court_service_status_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_court_system( - court_system_id, - **kwargs - ): - - """Court System Object for given courtSystemId. - - - Retrieve the specified court system. + court_system_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtSystemId value of the court system to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CourtSystem]: + + """Court System Object for given courtSystemId. + + Retrieve the specified court system. + + :param court_system_id: The courtSystemId value of the court system to be retrieved. (required) + :type court_system_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_court_system_with_http_info(court_system_id = court_system_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_court_system_with_http_info( + court_system_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtSystemId value of the court system to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtSystem]: + + """Court System Object for given courtSystemId. + + Retrieve the specified court system. + + :param court_system_id: The courtSystemId value of the court system to be retrieved. (required) + :type court_system_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_court_system_with_http_info(court_system_id = court_system_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_court_system_without_preload_content( + court_system_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtSystemId value of the court system to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Court System Object for given courtSystemId. + + Retrieve the specified court system. + + :param court_system_id: The courtSystemId value of the court system to be retrieved. (required) + :type court_system_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_court_system( - court_system_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_court_system_without_preload_content_with_http_info(court_system_id = court_system_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_court_systems( - **kwargs - ): - - """Court System Objects. - - - Retrieve information about the specified court system or court systems. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtSystemQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court system or court systems. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CourtSystemResponse]: + + """Court System Objects. + + Retrieve information about the specified court system or court systems. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtSystemQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court system or court systems. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_court_systems_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_court_systems_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court system or court systems. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtSystemResponse]: + + """Court System Objects. + + Retrieve information about the specified court system or court systems. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtSystemQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court system or court systems. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_court_systems_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_court_systems_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court system or court systems. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Court System Objects. + + Retrieve information about the specified court system or court systems. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtSystemQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court system or court systems. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_court_systems( - **kwargs - ) + response = CourtStandardsApi(api_client).get_court_systems_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_court_type( - court_type_id, - **kwargs - ): - - """Court Type Object for given courtTypeId. - - - Retrieve the information concerning the specific court type. + court_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtTypeId value of the court type to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CourtType]: + + """Court Type Object for given courtTypeId. + + Retrieve the information concerning the specific court type. + + :param court_type_id: The courtTypeId value of the court type to be retrieved. (required) + :type court_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_court_type_with_http_info(court_type_id = court_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_court_type_with_http_info( + court_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtTypeId value of the court type to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtType]: + + """Court Type Object for given courtTypeId. + + Retrieve the information concerning the specific court type. + + :param court_type_id: The courtTypeId value of the court type to be retrieved. (required) + :type court_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_court_type_with_http_info(court_type_id = court_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_court_type_without_preload_content( + court_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtTypeId value of the court type to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Court Type Object for given courtTypeId. + + Retrieve the information concerning the specific court type. + + :param court_type_id: The courtTypeId value of the court type to be retrieved. (required) + :type court_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_court_type( - court_type_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_court_type_without_preload_content_with_http_info(court_type_id = court_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_court_types( - **kwargs - ): - - """Court Type Objects. - - - Retrieve court types recognized by UniCourt. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtTypeQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court type or court types. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CourtTypeResponse]: + + """Court Type Objects. + + Retrieve court types recognized by UniCourt. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtTypeQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court type or court types. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_court_types_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_court_types_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court type or court types. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtTypeResponse]: + + """Court Type Objects. + + Retrieve court types recognized by UniCourt. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtTypeQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court type or court types. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_court_types_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_court_types_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court type or court types. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Court Type Objects. + + Retrieve court types recognized by UniCourt. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtTypeQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court type or court types. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_court_types( - **kwargs - ) + response = CourtStandardsApi(api_client).get_court_types_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_courts( - **kwargs - ): - - """Court Objects. - - - Retrieve information about a specified court or courts. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court or courts to be retrieved. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CourtResponse]: + + """Court Objects. + + Retrieve information about a specified court or courts. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court or courts to be retrieved. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_courts_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_courts_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court or courts to be retrieved. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtResponse]: + + """Court Objects. + + Retrieve information about a specified court or courts. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court or courts to be retrieved. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_courts_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_courts_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression that sets forth the criteria concerning the court or courts to be retrieved. Keyword expressions should be constructed according to the rules shown above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Court Objects. + + Retrieve information about a specified court or courts. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtQueryObject + + :param q: The keyword expression that sets forth the criteria concerning the court or courts to be retrieved. Keyword expressions should be constructed according to the rules shown above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_courts( - **kwargs - ) + response = CourtStandardsApi(api_client).get_courts_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_courts_for_court_location( - court_location_id, - **kwargs - ): - - """Associated Court for given Court Location. - - - Retrieve the courts associated with the specified court location. + court_location_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtLocationId value of the court location for which courts are to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CourtResponse]: + + """Associated Court for given Court Location. + + Retrieve the courts associated with the specified court location. + + :param court_location_id: The courtLocationId value of the court location for which courts are to be retrieved. (required) + :type court_location_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_courts_for_court_location_with_http_info(court_location_id = court_location_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_courts_for_court_location_with_http_info( + court_location_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtLocationId value of the court location for which courts are to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtResponse]: + + """Associated Court for given Court Location. + + Retrieve the courts associated with the specified court location. + + :param court_location_id: The courtLocationId value of the court location for which courts are to be retrieved. (required) + :type court_location_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_courts_for_court_location_with_http_info(court_location_id = court_location_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_courts_for_court_location_without_preload_content( + court_location_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtLocationId value of the court location for which courts are to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Associated Court for given Court Location. + + Retrieve the courts associated with the specified court location. + + :param court_location_id: The courtLocationId value of the court location for which courts are to be retrieved. (required) + :type court_location_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_courts_for_court_location( - court_location_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_courts_for_court_location_without_preload_content_with_http_info(court_location_id = court_location_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_courts_for_jurisdiction_geo( - jurisdiction_geo_id, - **kwargs - ): - - """Associated Court for given Jurisdiction Geo. - - - Returns Associated Court for given Jurisdiction Geo. + jurisdiction_geo_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="jurisdictionGeoId")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page number. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CourtResponse]: + + """Associated Court for given Jurisdiction Geo. + + Returns Associated Court for given Jurisdiction Geo. + + :param jurisdiction_geo_id: jurisdictionGeoId (required) + :type jurisdiction_geo_id: str + :param page_number: Page number. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: Sort field. + :type sort: str + :param order: Sort order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_courts_for_jurisdiction_geo_with_http_info(jurisdiction_geo_id = jurisdiction_geo_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_courts_for_jurisdiction_geo_with_http_info( + jurisdiction_geo_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="jurisdictionGeoId")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page number. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtResponse]: + + """Associated Court for given Jurisdiction Geo. + + Returns Associated Court for given Jurisdiction Geo. + + :param jurisdiction_geo_id: jurisdictionGeoId (required) + :type jurisdiction_geo_id: str + :param page_number: Page number. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: Sort field. + :type sort: str + :param order: Sort order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_courts_for_jurisdiction_geo_with_http_info(jurisdiction_geo_id = jurisdiction_geo_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_courts_for_jurisdiction_geo_without_preload_content( + jurisdiction_geo_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="jurisdictionGeoId")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page number. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Sort order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Associated Court for given Jurisdiction Geo. + + Returns Associated Court for given Jurisdiction Geo. + + :param jurisdiction_geo_id: jurisdictionGeoId (required) + :type jurisdiction_geo_id: str + :param page_number: Page number. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: Sort field. + :type sort: str + :param order: Sort order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_courts_for_jurisdiction_geo( - jurisdiction_geo_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_courts_for_jurisdiction_geo_without_preload_content_with_http_info(jurisdiction_geo_id = jurisdiction_geo_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_courts_service_status( - **kwargs - ): - - """Court Service Status Object. - - - Retrieve the status of one or more courts using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtServiceStatusQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired court. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[CourtServiceStatusResponse]: + + """Court Service Status Object. + + Retrieve the status of one or more courts using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtServiceStatusQueryObject + + :param q: The keyword expression targeting the desired court. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_courts_service_status_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_courts_service_status_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired court. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CourtServiceStatusResponse]: + + """Court Service Status Object. + + Retrieve the status of one or more courts using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtServiceStatusQueryObject + + :param q: The keyword expression targeting the desired court. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_courts_service_status_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_courts_service_status_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired court. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Court Service Status Object. + + Retrieve the status of one or more courts using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> CourtServiceStatusQueryObject + + :param q: The keyword expression targeting the desired court. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_courts_service_status( - **kwargs - ) + response = CourtStandardsApi(api_client).get_courts_service_status_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_judge_type( - judge_type_id, - **kwargs - ): - - """Judge Type Object for the given judgeTypeId. - - - Retrieve the specified judge type. + judge_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The judgeTypeId of the desired judge type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[JudgeType]: + + """Judge Type Object for the given judgeTypeId. + + Retrieve the specified judge type. + + :param judge_type_id: The judgeTypeId of the desired judge type. (required) + :type judge_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_judge_type_with_http_info(judge_type_id = judge_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_judge_type_with_http_info( + judge_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The judgeTypeId of the desired judge type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JudgeType]: + + """Judge Type Object for the given judgeTypeId. + + Retrieve the specified judge type. + + :param judge_type_id: The judgeTypeId of the desired judge type. (required) + :type judge_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_judge_type_with_http_info(judge_type_id = judge_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_judge_type_without_preload_content( + judge_type_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The judgeTypeId of the desired judge type.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Judge Type Object for the given judgeTypeId. + + Retrieve the specified judge type. + + :param judge_type_id: The judgeTypeId of the desired judge type. (required) + :type judge_type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_judge_type( - judge_type_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_judge_type_without_preload_content_with_http_info(judge_type_id = judge_type_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_judge_types( - **kwargs - ): - - """Judge Type Object. - - - Retrieve a judge type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JudgeTypeQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the judge type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[JudgeTypeResponse]: + + """Judge Type Object. + + Retrieve a judge type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JudgeTypeQueryObject + + :param q: The keyword expression targeting the judge type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_judge_types_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_judge_types_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the judge type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JudgeTypeResponse]: + + """Judge Type Object. + + Retrieve a judge type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JudgeTypeQueryObject + + :param q: The keyword expression targeting the judge type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_judge_types_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_judge_types_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the judge type. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Judge Type Object. + + Retrieve a judge type using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JudgeTypeQueryObject + + :param q: The keyword expression targeting the judge type. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_judge_types( - **kwargs - ) + response = CourtStandardsApi(api_client).get_judge_types_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_jurisdiction_geo( - jurisdiction_geo_id, - **kwargs - ): - - """Jurisdiction Geo Object for given Jurisdiction Geo Id. - - - Retrieve the specified jurisdiction geography. + jurisdiction_geo_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The jurisdictionGeoId value of the desired jurisdiction geography.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[JurisdictionGeo]: + + """Jurisdiction Geo Object for given Jurisdiction Geo Id. + + Retrieve the specified jurisdiction geography. + + :param jurisdiction_geo_id: The jurisdictionGeoId value of the desired jurisdiction geography. (required) + :type jurisdiction_geo_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_jurisdiction_geo_with_http_info(jurisdiction_geo_id = jurisdiction_geo_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_jurisdiction_geo_with_http_info( + jurisdiction_geo_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The jurisdictionGeoId value of the desired jurisdiction geography.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JurisdictionGeo]: + + """Jurisdiction Geo Object for given Jurisdiction Geo Id. + + Retrieve the specified jurisdiction geography. + + :param jurisdiction_geo_id: The jurisdictionGeoId value of the desired jurisdiction geography. (required) + :type jurisdiction_geo_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_jurisdiction_geo_with_http_info(jurisdiction_geo_id = jurisdiction_geo_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_jurisdiction_geo_without_preload_content( + jurisdiction_geo_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The jurisdictionGeoId value of the desired jurisdiction geography.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Jurisdiction Geo Object for given Jurisdiction Geo Id. + + Retrieve the specified jurisdiction geography. + + :param jurisdiction_geo_id: The jurisdictionGeoId value of the desired jurisdiction geography. (required) + :type jurisdiction_geo_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_jurisdiction_geo( - jurisdiction_geo_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_jurisdiction_geo_without_preload_content_with_http_info(jurisdiction_geo_id = jurisdiction_geo_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_jurisdiction_geo_for_court( - court_id, - **kwargs - ): - - """Jurisdiction Geo Objects for given courtId. - - - Retrieve the jurisdiction geography object for the specified court. + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[JurisdictionGeoResponse]: + + """Jurisdiction Geo Objects for given courtId. + + Retrieve the jurisdiction geography object for the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_jurisdiction_geo_for_court_with_http_info(court_id = court_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_jurisdiction_geo_for_court_with_http_info( + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JurisdictionGeoResponse]: + + """Jurisdiction Geo Objects for given courtId. + + Retrieve the jurisdiction geography object for the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_jurisdiction_geo_for_court_with_http_info(court_id = court_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_jurisdiction_geo_for_court_without_preload_content( + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the target court.")], + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[StrictStr], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Jurisdiction Geo Objects for given courtId. + + Retrieve the jurisdiction geography object for the specified court. + + :param court_id: The courtId value of the target court. (required) + :type court_id: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_jurisdiction_geo_for_court( - court_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_jurisdiction_geo_for_court_without_preload_content_with_http_info(court_id = court_id, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_jurisdictions_geo( - **kwargs - ): - - """Jurisdiction Geo Object. - - - Retrieve one or more jurisdiction geographies using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JurisdictionGeoQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired jurisdiction geography. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[JurisdictionGeoResponse]: + + """Jurisdiction Geo Object. + + Retrieve one or more jurisdiction geographies using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JurisdictionGeoQueryObject + + :param q: The keyword expression targeting the desired jurisdiction geography. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_jurisdictions_geo_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_jurisdictions_geo_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired jurisdiction geography. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JurisdictionGeoResponse]: + + """Jurisdiction Geo Object. + + Retrieve one or more jurisdiction geographies using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JurisdictionGeoQueryObject + + :param q: The keyword expression targeting the desired jurisdiction geography. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_jurisdictions_geo_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_jurisdictions_geo_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired jurisdiction geography. Keyword expressions should be constructed according to the rules given above. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Jurisdiction Geo Object. + + Retrieve one or more jurisdiction geographies using a keyword expression. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> JurisdictionGeoQueryObject + + :param q: The keyword expression targeting the desired jurisdiction geography. Keyword expressions should be constructed according to the rules given above. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_jurisdictions_geo( - **kwargs - ) + response = CourtStandardsApi(api_client).get_jurisdictions_geo_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_party_role( - party_role_id, - **kwargs - ): - - """Party Role Object. - - - Retrieve the specified party role. + party_role_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The partyRoleId value of the desired party role.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PartyRole]: + + """Party Role Object. + + Retrieve the specified party role. + + :param party_role_id: The partyRoleId value of the desired party role. (required) + :type party_role_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_party_role_with_http_info(party_role_id = party_role_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_party_role_with_http_info( + party_role_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The partyRoleId value of the desired party role.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PartyRole]: + + """Party Role Object. + + Retrieve the specified party role. + + :param party_role_id: The partyRoleId value of the desired party role. (required) + :type party_role_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_party_role_with_http_info(party_role_id = party_role_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_party_role_without_preload_content( + party_role_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The partyRoleId value of the desired party role.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Party Role Object. + + Retrieve the specified party role. + + :param party_role_id: The partyRoleId value of the desired party role. (required) + :type party_role_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_party_role( - party_role_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_party_role_without_preload_content_with_http_info(party_role_id = party_role_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_party_role_group( - party_role_group_id, - **kwargs - ): - - """Party Role Group Object. - - - Retrieve the specified party role group. + party_role_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The partyRoleGroupId value of the desired party role group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PartyRoleGroup]: + + """Party Role Group Object. + + Retrieve the specified party role group. + + :param party_role_group_id: The partyRoleGroupId value of the desired party role group. (required) + :type party_role_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_party_role_group_with_http_info(party_role_group_id = party_role_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_party_role_group_with_http_info( + party_role_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The partyRoleGroupId value of the desired party role group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PartyRoleGroup]: + + """Party Role Group Object. + + Retrieve the specified party role group. + + :param party_role_group_id: The partyRoleGroupId value of the desired party role group. (required) + :type party_role_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_party_role_group_with_http_info(party_role_group_id = party_role_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_party_role_group_without_preload_content( + party_role_group_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The partyRoleGroupId value of the desired party role group.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Party Role Group Object. + + Retrieve the specified party role group. + + :param party_role_group_id: The partyRoleGroupId value of the desired party role group. (required) + :type party_role_group_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_party_role_group( - party_role_group_id, - **kwargs - ) + response = CourtStandardsApi(api_client).get_party_role_group_without_preload_content_with_http_info(party_role_group_id = party_role_group_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_party_role_groups( - **kwargs - ): - - """Party Role Group Object. - - - Retrieve a party role group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleGroupQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party role group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PartyRoleGroupResponse]: + + """Party Role Group Object. + + Retrieve a party role group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleGroupQueryObject + + :param q: The keyword expression targeting the desired party role group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_party_role_groups_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_party_role_groups_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party role group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PartyRoleGroupResponse]: + + """Party Role Group Object. + + Retrieve a party role group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleGroupQueryObject + + :param q: The keyword expression targeting the desired party role group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_party_role_groups_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_party_role_groups_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party role group. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Party Role Group Object. + + Retrieve a party role group using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleGroupQueryObject + + :param q: The keyword expression targeting the desired party role group. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_party_role_groups( - **kwargs - ) + response = CourtStandardsApi(api_client).get_party_role_groups_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_party_roles( - **kwargs - ): - - """Party Role Object. - - - Retrieve a party role using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleQueryObject + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party role. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PartyRoleResponse]: + + """Party Role Object. + + Retrieve a party role using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleQueryObject + + :param q: The keyword expression targeting the desired party role. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = CourtStandardsApi(api_client).get_party_roles_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_party_roles_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party role. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PartyRoleResponse]: + + """Party Role Object. + + Retrieve a party role using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleQueryObject + + :param q: The keyword expression targeting the desired party role. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return CourtStandardsApi(api_client).get_party_roles_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_party_roles_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party role. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="The page number of the results to be retrieved. - minimum: 1 - maximum: 100 ")] = None, + sort: Annotated[Optional[Annotated[str, Field(min_length=4, strict=True, max_length=4)]], Field(description="The field according to which search results are to be sorted.")] = None, + order: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=4)]], Field(description="Whether search results are to be shown in ascending or descending order.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Party Role Object. + + Retrieve a party role using a keyword expression. Keyword expressions should be constructed according to the rules given above. ## Logical Operators | Connector | Description | Example | | ------| ------|------| | **AND** |Find data containing all connected terms.|**google AND facebook**| | **OR** |Find data containing any connected term.| **order OR decision**| | **NOT** |Exclude data.| **google NOT apple**.| | **“[phrase]”** |Find an exact phrase.| **\"Google Inc”** | | **( … )** |Parenthesis may be used to group sets of terms of connectors.| **google (facebook OR apple)**.| ### All Filter Query parameters supported for this API can be found in below schema section. Schema --> PartyRoleQueryObject + + :param q: The keyword expression targeting the desired party role. + :type q: str + :param page_number: The page number of the results to be retrieved. - minimum: 1 - maximum: 100 + :type page_number: int + :param sort: The field according to which search results are to be sorted. + :type sort: str + :param order: Whether search results are to be shown in ascending or descending order. + :type order: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return CourtStandardsApi(api_client).get_party_roles( - **kwargs - ) + response = CourtStandardsApi(api_client).get_party_roles_without_preload_content_with_http_info(q = q, page_number = page_number, sort = sort, order = order, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/JudgeAnalytics.py b/unicourt/sdk/JudgeAnalytics.py index f6779cf..aff3de3 100644 --- a/unicourt/sdk/JudgeAnalytics.py +++ b/unicourt/sdk/JudgeAnalytics.py @@ -1,127 +1,949 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated +from unicourt.model.associated_norm_attorney_response import AssociatedNormAttorneyResponse +from unicourt.model.associated_norm_law_firm_response import AssociatedNormLawFirmResponse +from unicourt.model.associated_norm_party_response import AssociatedNormPartyResponse +from unicourt.model.norm_judge import NormJudge +from unicourt.model.norm_judge_search_response import NormJudgeSearchResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.judge_analytics_api import JudgeAnalyticsApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class JudgeAnalytics: @staticmethod def get_norm_attorneys_associated_with_norm_judge( - norm_judge_id, - **kwargs - ): - - """Attorneys Associated with the Judge. - - - Search for attorneys who have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AssociatedNormAttorneyResponse]: + + """Attorneys Associated with the Judge. + + Search for attorneys who have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = JudgeAnalyticsApi(api_client).get_norm_attorneys_associated_with_norm_judge_with_http_info(norm_judge_id = norm_judge_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_attorneys_associated_with_norm_judge_with_http_info( + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormAttorneyResponse]: + + """Attorneys Associated with the Judge. + + Search for attorneys who have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return JudgeAnalyticsApi(api_client).get_norm_attorneys_associated_with_norm_judge_with_http_info(norm_judge_id = norm_judge_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_attorneys_associated_with_norm_judge_without_preload_content( + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Attorneys Associated with the Judge. + + Search for attorneys who have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return JudgeAnalyticsApi(api_client).get_norm_attorneys_associated_with_norm_judge( - norm_judge_id, - **kwargs - ) + response = JudgeAnalyticsApi(api_client).get_norm_attorneys_associated_with_norm_judge_without_preload_content_with_http_info(norm_judge_id = norm_judge_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_norm_judge_by_id( - norm_judge_id, - **kwargs - ): - - """Norm Judge Details. - - - Retrieve the specified judge. + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[NormJudge]: + + """Norm Judge Details. + + Retrieve the specified judge. + + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = JudgeAnalyticsApi(api_client).get_norm_judge_by_id_with_http_info(norm_judge_id = norm_judge_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_judge_by_id_with_http_info( + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormJudge]: + + """Norm Judge Details. + + Retrieve the specified judge. + + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return JudgeAnalyticsApi(api_client).get_norm_judge_by_id_with_http_info(norm_judge_id = norm_judge_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_judge_by_id_without_preload_content( + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Norm Judge Details. + + Retrieve the specified judge. + + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return JudgeAnalyticsApi(api_client).get_norm_judge_by_id( - norm_judge_id, - **kwargs - ) + response = JudgeAnalyticsApi(api_client).get_norm_judge_by_id_without_preload_content_with_http_info(norm_judge_id = norm_judge_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_norm_law_firms_associated_with_norm_judge( - norm_judge_id, - **kwargs - ): - - """Law Firms Associated With the Judge. - - - Search for law firms that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLOPUfJRhw5yPxgRi\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Law Firms associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired law firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AssociatedNormLawFirmResponse]: + + """Law Firms Associated With the Judge. + + Search for law firms that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLOPUfJRhw5yPxgRi\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Law Firms associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = JudgeAnalyticsApi(api_client).get_norm_law_firms_associated_with_norm_judge_with_http_info(norm_judge_id = norm_judge_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_law_firms_associated_with_norm_judge_with_http_info( + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired law firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormLawFirmResponse]: + + """Law Firms Associated With the Judge. + + Search for law firms that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLOPUfJRhw5yPxgRi\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Law Firms associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return JudgeAnalyticsApi(api_client).get_norm_law_firms_associated_with_norm_judge_with_http_info(norm_judge_id = norm_judge_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_law_firms_associated_with_norm_judge_without_preload_content( + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired law firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Law Firms Associated With the Judge. + + Search for law firms that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLOPUfJRhw5yPxgRi\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Law Firms associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return JudgeAnalyticsApi(api_client).get_norm_law_firms_associated_with_norm_judge( - norm_judge_id, - **kwargs - ) + response = JudgeAnalyticsApi(api_client).get_norm_law_firms_associated_with_norm_judge_without_preload_content_with_http_info(norm_judge_id = norm_judge_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_norm_parties_associated_with_norm_judge( - norm_judge_id, - **kwargs - ): - - """Parties Associated with the Judge. - - - Search for parties that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Parties associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AssociatedNormPartyResponse]: + + """Parties Associated with the Judge. + + Search for parties that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Parties associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired parties. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = JudgeAnalyticsApi(api_client).get_norm_parties_associated_with_norm_judge_with_http_info(norm_judge_id = norm_judge_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_parties_associated_with_norm_judge_with_http_info( + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormPartyResponse]: + + """Parties Associated with the Judge. + + Search for parties that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Parties associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired parties. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return JudgeAnalyticsApi(api_client).get_norm_parties_associated_with_norm_judge_with_http_info(norm_judge_id = norm_judge_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_parties_associated_with_norm_judge_without_preload_content( + norm_judge_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Parties Associated with the Judge. + + Search for parties that have appeared before the specified judge using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtLocationId IN (\"COLODj4BBVTho3pKpz\",\"COLOPUfJRhw5yPxgRi\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all Parties associated with judge with norm id NJUDT7jCZyFNeLGpRq of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_judge_id: The normJudgeId value of the desired judge. - minimum: 18 - maximum: 18 (required) + :type norm_judge_id: str + :param q: The keyword expression targeting the desired parties. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return JudgeAnalyticsApi(api_client).get_norm_parties_associated_with_norm_judge( - norm_judge_id, - **kwargs - ) + response = JudgeAnalyticsApi(api_client).get_norm_parties_associated_with_norm_judge_without_preload_content_with_http_info(norm_judge_id = norm_judge_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def search_normalized_judges( - **kwargs - ): - - """Judge search. - - - ### Search for a judge using a keyword expression. + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired judge. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[NormJudgeSearchResponse]: + + """Judge search. + + ### Search for a judge using a keyword expression. + + :param q: The keyword expression targeting the desired judge. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = JudgeAnalyticsApi(api_client).search_normalized_judges_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def search_normalized_judges_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired judge. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormJudgeSearchResponse]: + + """Judge search. + + ### Search for a judge using a keyword expression. + + :param q: The keyword expression targeting the desired judge. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return JudgeAnalyticsApi(api_client).search_normalized_judges_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def search_normalized_judges_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired judge. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Judge search. + + ### Search for a judge using a keyword expression. + + :param q: The keyword expression targeting the desired judge. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return JudgeAnalyticsApi(api_client).search_normalized_judges( - **kwargs - ) + response = JudgeAnalyticsApi(api_client).search_normalized_judges_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def search_normalized_judges_by_id( - norm_judge_search_id, - **kwargs - ): - - """Norm judge search results for a given normJudgeSearchId. - - - ### Retrieve the desired search for a judge. + norm_judge_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeSearchId value of the desired search.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[NormJudgeSearchResponse]: + + """Norm judge search results for a given normJudgeSearchId. + + ### Retrieve the desired search for a judge. + + :param norm_judge_search_id: The normJudgeSearchId value of the desired search. (required) + :type norm_judge_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = JudgeAnalyticsApi(api_client).search_normalized_judges_by_id_with_http_info(norm_judge_search_id = norm_judge_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def search_normalized_judges_by_id_with_http_info( + norm_judge_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeSearchId value of the desired search.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormJudgeSearchResponse]: + + """Norm judge search results for a given normJudgeSearchId. + + ### Retrieve the desired search for a judge. + + :param norm_judge_search_id: The normJudgeSearchId value of the desired search. (required) + :type norm_judge_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return JudgeAnalyticsApi(api_client).search_normalized_judges_by_id_with_http_info(norm_judge_search_id = norm_judge_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def search_normalized_judges_by_id_without_preload_content( + norm_judge_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normJudgeSearchId value of the desired search.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Norm judge search results for a given normJudgeSearchId. + + ### Retrieve the desired search for a judge. + + :param norm_judge_search_id: The normJudgeSearchId value of the desired search. (required) + :type norm_judge_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return JudgeAnalyticsApi(api_client).search_normalized_judges_by_id( - norm_judge_search_id, - **kwargs - ) + response = JudgeAnalyticsApi(api_client).search_normalized_judges_by_id_without_preload_content_with_http_info(norm_judge_search_id = norm_judge_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/LawFirmAnalytics.py b/unicourt/sdk/LawFirmAnalytics.py index c08f26e..f19dda1 100644 --- a/unicourt/sdk/LawFirmAnalytics.py +++ b/unicourt/sdk/LawFirmAnalytics.py @@ -1,127 +1,949 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated +from unicourt.model.associated_norm_attorney_response import AssociatedNormAttorneyResponse +from unicourt.model.associated_norm_judge_response import AssociatedNormJudgeResponse +from unicourt.model.associated_norm_party_response import AssociatedNormPartyResponse +from unicourt.model.norm_law_firm import NormLawFirm +from unicourt.model.norm_law_firm_search_response import NormLawFirmSearchResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.law_firm_analytics_api import LawFirmAnalyticsApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class LawFirmAnalytics: @staticmethod def get_norm_attorneys_associated_with_norm_law_firm( - norm_law_firm_id, - **kwargs - ): - - """Attorneys working for the Law Firm. - - - Retrieve the attorneys associated with a given normalized law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AssociatedNormAttorneyResponse]: + + """Attorneys working for the Law Firm. + + Retrieve the attorneys associated with a given normalized law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired attorneys. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = LawFirmAnalyticsApi(api_client).get_norm_attorneys_associated_with_norm_law_firm_with_http_info(norm_law_firm_id = norm_law_firm_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_attorneys_associated_with_norm_law_firm_with_http_info( + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormAttorneyResponse]: + + """Attorneys working for the Law Firm. + + Retrieve the attorneys associated with a given normalized law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired attorneys. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return LawFirmAnalyticsApi(api_client).get_norm_attorneys_associated_with_norm_law_firm_with_http_info(norm_law_firm_id = norm_law_firm_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_attorneys_associated_with_norm_law_firm_without_preload_content( + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Attorneys working for the Law Firm. + + Retrieve the attorneys associated with a given normalized law firm. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired attorneys. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return LawFirmAnalyticsApi(api_client).get_norm_attorneys_associated_with_norm_law_firm( - norm_law_firm_id, - **kwargs - ) + response = LawFirmAnalyticsApi(api_client).get_norm_attorneys_associated_with_norm_law_firm_without_preload_content_with_http_info(norm_law_firm_id = norm_law_firm_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_norm_judges_associated_with_norm_law_firm( - norm_law_firm_id, - **kwargs - ): - - """Judges Faced By the Law Firm. - - - Retrieve the judges before which a given normalized law firm has appeared.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AssociatedNormJudgeResponse]: + + """Judges Faced By the Law Firm. + + Retrieve the judges before which a given normalized law firm has appeared.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = LawFirmAnalyticsApi(api_client).get_norm_judges_associated_with_norm_law_firm_with_http_info(norm_law_firm_id = norm_law_firm_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_judges_associated_with_norm_law_firm_with_http_info( + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormJudgeResponse]: + + """Judges Faced By the Law Firm. + + Retrieve the judges before which a given normalized law firm has appeared.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return LawFirmAnalyticsApi(api_client).get_norm_judges_associated_with_norm_law_firm_with_http_info(norm_law_firm_id = norm_law_firm_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_judges_associated_with_norm_law_firm_without_preload_content( + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Judges Faced By the Law Firm. + + Retrieve the judges before which a given normalized law firm has appeared.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple Ids Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return LawFirmAnalyticsApi(api_client).get_norm_judges_associated_with_norm_law_firm( - norm_law_firm_id, - **kwargs - ) + response = LawFirmAnalyticsApi(api_client).get_norm_judges_associated_with_norm_law_firm_without_preload_content_with_http_info(norm_law_firm_id = norm_law_firm_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_norm_law_firm_by_id( - norm_law_firm_id, - **kwargs - ): - - """Norm LawFirm Details. - - - Retrieve the specified normalized law firm. + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[NormLawFirm]: + + """Norm LawFirm Details. + + Retrieve the specified normalized law firm. + + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = LawFirmAnalyticsApi(api_client).get_norm_law_firm_by_id_with_http_info(norm_law_firm_id = norm_law_firm_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_law_firm_by_id_with_http_info( + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormLawFirm]: + + """Norm LawFirm Details. + + Retrieve the specified normalized law firm. + + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return LawFirmAnalyticsApi(api_client).get_norm_law_firm_by_id_with_http_info(norm_law_firm_id = norm_law_firm_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_law_firm_by_id_without_preload_content( + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Norm LawFirm Details. + + Retrieve the specified normalized law firm. + + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return LawFirmAnalyticsApi(api_client).get_norm_law_firm_by_id( - norm_law_firm_id, - **kwargs - ) + response = LawFirmAnalyticsApi(api_client).get_norm_law_firm_by_id_without_preload_content_with_http_info(norm_law_firm_id = norm_law_firm_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_norm_parties_associated_with_norm_law_firm( - norm_law_firm_id, - **kwargs - ): - - """Parties Represented by the Law Firm. - - - Retrieve the parties that the given normalized law firm has represented. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AssociatedNormPartyResponse]: + + """Parties Represented by the Law Firm. + + Retrieve the parties that the given normalized law firm has represented. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = LawFirmAnalyticsApi(api_client).get_norm_parties_associated_with_norm_law_firm_with_http_info(norm_law_firm_id = norm_law_firm_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_parties_associated_with_norm_law_firm_with_http_info( + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormPartyResponse]: + + """Parties Represented by the Law Firm. + + Retrieve the parties that the given normalized law firm has represented. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return LawFirmAnalyticsApi(api_client).get_norm_parties_associated_with_norm_law_firm_with_http_info(norm_law_firm_id = norm_law_firm_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_parties_associated_with_norm_law_firm_without_preload_content( + norm_law_firm_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Parties Represented by the Law Firm. + + Retrieve the parties that the given normalized law firm has represented. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTKQiA4LJuv54tEj\",\"CORTV4vCEaKrhystBz\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all parties associated with LawFirm with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_law_firm_id: The normLawFirmId value of the desired normalized law firm. - minimum: 18 - maximum: 18 (required) + :type norm_law_firm_id: str + :param q: The keyword expression targeting the desired parties. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return LawFirmAnalyticsApi(api_client).get_norm_parties_associated_with_norm_law_firm( - norm_law_firm_id, - **kwargs - ) + response = LawFirmAnalyticsApi(api_client).get_norm_parties_associated_with_norm_law_firm_without_preload_content_with_http_info(norm_law_firm_id = norm_law_firm_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def search_normalized_law_firms( - **kwargs - ): - - """Law firm search. - - - ### Retrieve a normalized law firm using a keyword expression. + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired law firms. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[NormLawFirmSearchResponse]: + + """Law firm search. + + ### Retrieve a normalized law firm using a keyword expression. + + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = LawFirmAnalyticsApi(api_client).search_normalized_law_firms_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def search_normalized_law_firms_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired law firms. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormLawFirmSearchResponse]: + + """Law firm search. + + ### Retrieve a normalized law firm using a keyword expression. + + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return LawFirmAnalyticsApi(api_client).search_normalized_law_firms_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def search_normalized_law_firms_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired law firms. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Law firm search. + + ### Retrieve a normalized law firm using a keyword expression. + + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return LawFirmAnalyticsApi(api_client).search_normalized_law_firms( - **kwargs - ) + response = LawFirmAnalyticsApi(api_client).search_normalized_law_firms_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def search_normalized_law_firms_by_id( - norm_law_firm_search_id, - **kwargs - ): - - """Norm law firm search result for a given normLawFirmSearchId. - - - ### Retrieve the specified search for a normalized law firm. + norm_law_firm_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmSearchId value of the search to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[NormLawFirmSearchResponse]: + + """Norm law firm search result for a given normLawFirmSearchId. + + ### Retrieve the specified search for a normalized law firm. + + :param norm_law_firm_search_id: The normLawFirmSearchId value of the search to be retrieved. (required) + :type norm_law_firm_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = LawFirmAnalyticsApi(api_client).search_normalized_law_firms_by_id_with_http_info(norm_law_firm_search_id = norm_law_firm_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def search_normalized_law_firms_by_id_with_http_info( + norm_law_firm_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmSearchId value of the search to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormLawFirmSearchResponse]: + + """Norm law firm search result for a given normLawFirmSearchId. + + ### Retrieve the specified search for a normalized law firm. + + :param norm_law_firm_search_id: The normLawFirmSearchId value of the search to be retrieved. (required) + :type norm_law_firm_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return LawFirmAnalyticsApi(api_client).search_normalized_law_firms_by_id_with_http_info(norm_law_firm_search_id = norm_law_firm_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def search_normalized_law_firms_by_id_without_preload_content( + norm_law_firm_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normLawFirmSearchId value of the search to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Norm law firm search result for a given normLawFirmSearchId. + + ### Retrieve the specified search for a normalized law firm. + + :param norm_law_firm_search_id: The normLawFirmSearchId value of the search to be retrieved. (required) + :type norm_law_firm_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return LawFirmAnalyticsApi(api_client).search_normalized_law_firms_by_id( - norm_law_firm_search_id, - **kwargs - ) + response = LawFirmAnalyticsApi(api_client).search_normalized_law_firms_by_id_without_preload_content_with_http_info(norm_law_firm_search_id = norm_law_firm_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/PACER.py b/unicourt/sdk/PACER.py index 7ec44a5..9352437 100644 --- a/unicourt/sdk/PACER.py +++ b/unicourt/sdk/PACER.py @@ -1,306 +1,4253 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from datetime import datetime +from pydantic import Field, StrictBool, StrictInt, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from unicourt.model.pacer_import_case import PACERImportCase +from unicourt.model.pcl_case import PCLCase +from unicourt.model.pcl_party import PCLParty +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.pacer_api import PACERApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class PACER: @staticmethod def all_courts_pacer_case_locator_case_search( - pacer_user_id, - pacer_client_code, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PCLCase]: - """PACER Case Locator Search API for All Courts. + """PACER Case Locator Search API for All Courts. + Search all courts within the PACER system for a particular case. - Search all courts within the PACER system for a particular case. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).all_courts_pacer_case_locator_case_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def all_courts_pacer_case_locator_case_search_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLCase]: + + """PACER Case Locator Search API for All Courts. + + Search all courts within the PACER system for a particular case. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PACERApi(api_client).all_courts_pacer_case_locator_case_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def all_courts_pacer_case_locator_case_search_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """PACER Case Locator Search API for All Courts. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Search all courts within the PACER system for a particular case. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERApi(api_client).all_courts_pacer_case_locator_case_search( - pacer_user_id, - pacer_client_code, - **kwargs - ) + response = PACERApi(api_client).all_courts_pacer_case_locator_case_search_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def all_courts_pacer_case_locator_party_search( - pacer_user_id, - pacer_client_code, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case.")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PCLParty]: + + """PACER Case Locator Search API for All Courts. - """PACER Case Locator Search API for All Courts. + Search for the specified party across all PACER case filings. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).all_courts_pacer_case_locator_party_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + @staticmethod + def all_courts_pacer_case_locator_party_search_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case.")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLParty]: - Search for the specified party across all PACER case filings. + """PACER Case Locator Search API for All Courts. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Search for the specified party across all PACER case filings. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERApi(api_client).all_courts_pacer_case_locator_party_search( - pacer_user_id, - pacer_client_code, - **kwargs - ) + return PACERApi(api_client).all_courts_pacer_case_locator_party_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def all_courts_pacer_case_locator_party_search_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case.")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """PACER Case Locator Search API for All Courts. + + Search for the specified party across all PACER case filings. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).all_courts_pacer_case_locator_party_search_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def appeal_courts_pacer_case_locator_case_search( - pacer_user_id, - pacer_client_code, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + nature_of_suits_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases in U.S. Courts of Appeals. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 1110 (Insurance) and 1150 (Overpayments & Enforc. of Judgments), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=1110&natureOfSuitsArray=1150")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PCLCase]: + + """PACER Case Locator Search API for All Courts. - """PACER Case Locator Search API for All Courts. + Search for PACER cases filed in U.S. Courts of Appeals. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param nature_of_suits_array: The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases in U.S. Courts of Appeals. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 1110 (Insurance) and 1150 (Overpayments & Enforc. of Judgments), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=1110&natureOfSuitsArray=1150 + :type nature_of_suits_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).appeal_courts_pacer_case_locator_case_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, nature_of_suits_array = nature_of_suits_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - Search for PACER cases filed in U.S. Courts of Appeals. + @staticmethod + def appeal_courts_pacer_case_locator_case_search_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + nature_of_suits_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases in U.S. Courts of Appeals. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 1110 (Insurance) and 1150 (Overpayments & Enforc. of Judgments), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=1110&natureOfSuitsArray=1150")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLCase]: - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + """PACER Case Locator Search API for All Courts. + Search for PACER cases filed in U.S. Courts of Appeals. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param nature_of_suits_array: The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases in U.S. Courts of Appeals. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 1110 (Insurance) and 1150 (Overpayments & Enforc. of Judgments), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=1110&natureOfSuitsArray=1150 + :type nature_of_suits_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERApi(api_client).appeal_courts_pacer_case_locator_case_search( - pacer_user_id, - pacer_client_code, - **kwargs - ) + return PACERApi(api_client).appeal_courts_pacer_case_locator_case_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, nature_of_suits_array = nature_of_suits_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def appeal_courts_pacer_case_locator_case_search_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + nature_of_suits_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases in U.S. Courts of Appeals. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 1110 (Insurance) and 1150 (Overpayments & Enforc. of Judgments), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=1110&natureOfSuitsArray=1150")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """PACER Case Locator Search API for All Courts. + + Search for PACER cases filed in U.S. Courts of Appeals. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param nature_of_suits_array: The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases in U.S. Courts of Appeals. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 1110 (Insurance) and 1150 (Overpayments & Enforc. of Judgments), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=1110&natureOfSuitsArray=1150 + :type nature_of_suits_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).appeal_courts_pacer_case_locator_case_search_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, nature_of_suits_array = nature_of_suits_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def appeal_courts_pacer_case_locator_party_search( - pacer_user_id, - pacer_client_code, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PCLParty]: + + """PACER Case Locator Search API for All Courts. + + Search for the specified party across all PACER appeals cases. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).appeal_courts_pacer_case_locator_party_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def appeal_courts_pacer_case_locator_party_search_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLParty]: + + """PACER Case Locator Search API for All Courts. - """PACER Case Locator Search API for All Courts. + Search for the specified party across all PACER appeals cases. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PACERApi(api_client).appeal_courts_pacer_case_locator_party_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) - Search for the specified party across all PACER appeals cases. + @staticmethod + def appeal_courts_pacer_case_locator_party_search_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + """PACER Case Locator Search API for All Courts. + Search for the specified party across all PACER appeals cases. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERApi(api_client).appeal_courts_pacer_case_locator_party_search( - pacer_user_id, - pacer_client_code, - **kwargs - ) + response = PACERApi(api_client).appeal_courts_pacer_case_locator_party_search_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def bankruptcy_courts_pacer_case_locator_case_search( - pacer_user_id, - pacer_client_code, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + federal_bankruptcy_chapter_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The chapter of the U.S. Bankruptcy Code under which the target case was filed. Please refer PCL Bankruptcy Chapters for a list of valid chapter numbers. Scenario: When mulitple Federal Bankruptcy Chapters needs to be requested. Imagine for a given case number 12-1234 I would like to search with the Federal Bankruptcy Chapters 7 (Chapter 7) and 11 (Chapter 11), My query in the request will look like the example mentioned below. Example: federalBankruptcyChapterArray=7&federalBankruptcyChapterArray=11")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_discharged_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_discharged_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PCLCase]: + + """PACER Case Locator Search API for Bankruptcy Courts. - """PACER Case Locator Search API for Bankruptcy Courts. + Search for PACER cases filed in U.S. Bankruptcy Courts. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param federal_bankruptcy_chapter_array: The chapter of the U.S. Bankruptcy Code under which the target case was filed. Please refer PCL Bankruptcy Chapters for a list of valid chapter numbers. Scenario: When mulitple Federal Bankruptcy Chapters needs to be requested. Imagine for a given case number 12-1234 I would like to search with the Federal Bankruptcy Chapters 7 (Chapter 7) and 11 (Chapter 11), My query in the request will look like the example mentioned below. Example: federalBankruptcyChapterArray=7&federalBankruptcyChapterArray=11 + :type federal_bankruptcy_chapter_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param case_discharged_start_date: The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_start_date: datetime + :param case_discharged_end_date: The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_end_date: datetime + :param case_dismissed_start_date: The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_dismissed_start_date: datetime + :param case_dismissed_end_date: The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_dismissed_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).bankruptcy_courts_pacer_case_locator_case_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, federal_bankruptcy_chapter_array = federal_bankruptcy_chapter_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, case_discharged_start_date = case_discharged_start_date, case_discharged_end_date = case_discharged_end_date, case_dismissed_start_date = case_dismissed_start_date, case_dismissed_end_date = case_dismissed_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - Search for PACER cases filed in U.S. Bankruptcy Courts. + @staticmethod + def bankruptcy_courts_pacer_case_locator_case_search_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + federal_bankruptcy_chapter_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The chapter of the U.S. Bankruptcy Code under which the target case was filed. Please refer PCL Bankruptcy Chapters for a list of valid chapter numbers. Scenario: When mulitple Federal Bankruptcy Chapters needs to be requested. Imagine for a given case number 12-1234 I would like to search with the Federal Bankruptcy Chapters 7 (Chapter 7) and 11 (Chapter 11), My query in the request will look like the example mentioned below. Example: federalBankruptcyChapterArray=7&federalBankruptcyChapterArray=11")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_discharged_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_discharged_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLCase]: - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + """PACER Case Locator Search API for Bankruptcy Courts. + Search for PACER cases filed in U.S. Bankruptcy Courts. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param federal_bankruptcy_chapter_array: The chapter of the U.S. Bankruptcy Code under which the target case was filed. Please refer PCL Bankruptcy Chapters for a list of valid chapter numbers. Scenario: When mulitple Federal Bankruptcy Chapters needs to be requested. Imagine for a given case number 12-1234 I would like to search with the Federal Bankruptcy Chapters 7 (Chapter 7) and 11 (Chapter 11), My query in the request will look like the example mentioned below. Example: federalBankruptcyChapterArray=7&federalBankruptcyChapterArray=11 + :type federal_bankruptcy_chapter_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param case_discharged_start_date: The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_start_date: datetime + :param case_discharged_end_date: The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_end_date: datetime + :param case_dismissed_start_date: The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_dismissed_start_date: datetime + :param case_dismissed_end_date: The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_dismissed_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERApi(api_client).bankruptcy_courts_pacer_case_locator_case_search( - pacer_user_id, - pacer_client_code, - **kwargs - ) + return PACERApi(api_client).bankruptcy_courts_pacer_case_locator_case_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, federal_bankruptcy_chapter_array = federal_bankruptcy_chapter_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, case_discharged_start_date = case_discharged_start_date, case_discharged_end_date = case_discharged_end_date, case_dismissed_start_date = case_dismissed_start_date, case_dismissed_end_date = case_dismissed_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def bankruptcy_courts_pacer_case_locator_case_search_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + federal_bankruptcy_chapter_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The chapter of the U.S. Bankruptcy Code under which the target case was filed. Please refer PCL Bankruptcy Chapters for a list of valid chapter numbers. Scenario: When mulitple Federal Bankruptcy Chapters needs to be requested. Imagine for a given case number 12-1234 I would like to search with the Federal Bankruptcy Chapters 7 (Chapter 7) and 11 (Chapter 11), My query in the request will look like the example mentioned below. Example: federalBankruptcyChapterArray=7&federalBankruptcyChapterArray=11")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_discharged_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_discharged_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """PACER Case Locator Search API for Bankruptcy Courts. + + Search for PACER cases filed in U.S. Bankruptcy Courts. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param federal_bankruptcy_chapter_array: The chapter of the U.S. Bankruptcy Code under which the target case was filed. Please refer PCL Bankruptcy Chapters for a list of valid chapter numbers. Scenario: When mulitple Federal Bankruptcy Chapters needs to be requested. Imagine for a given case number 12-1234 I would like to search with the Federal Bankruptcy Chapters 7 (Chapter 7) and 11 (Chapter 11), My query in the request will look like the example mentioned below. Example: federalBankruptcyChapterArray=7&federalBankruptcyChapterArray=11 + :type federal_bankruptcy_chapter_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param case_discharged_start_date: The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_start_date: datetime + :param case_discharged_end_date: The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_end_date: datetime + :param case_dismissed_start_date: The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_dismissed_start_date: datetime + :param case_dismissed_end_date: The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_dismissed_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).bankruptcy_courts_pacer_case_locator_case_search_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, federal_bankruptcy_chapter_array = federal_bankruptcy_chapter_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, case_discharged_start_date = case_discharged_start_date, case_discharged_end_date = case_discharged_end_date, case_dismissed_start_date = case_dismissed_start_date, case_dismissed_end_date = case_dismissed_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def bankruptcy_courts_pacer_case_locator_party_search( - pacer_user_id, - pacer_client_code, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + ssn_or_ein: Annotated[Optional[Annotated[str, Field(strict=True, max_length=9)]], Field(description="The Social Security number or the federal Employer Identification Number of the target party. Either number can be entered with or without dashes.")] = None, + four_digit_ssn: Annotated[Optional[Annotated[str, Field(strict=True, max_length=4)]], Field(description="The last four digits of the Social Security number of the target party. Note: When specified, a last name/entity name must also be specified.")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_discharged_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_discharged_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PCLParty]: + + """PACER Case Locator Search API for All Courts. + + Search for the specified party in PACER bankruptcy filings. - """PACER Case Locator Search API for All Courts. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param ssn_or_ein: The Social Security number or the federal Employer Identification Number of the target party. Either number can be entered with or without dashes. + :type ssn_or_ein: str + :param four_digit_ssn: The last four digits of the Social Security number of the target party. Note: When specified, a last name/entity name must also be specified. + :type four_digit_ssn: str + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param case_discharged_start_date: The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_start_date: datetime + :param case_discharged_end_date: The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_end_date: datetime + :param case_dismissed_start_date: The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_dismissed_start_date: datetime + :param case_dismissed_end_date: The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_dismissed_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).bankruptcy_courts_pacer_case_locator_party_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, ssn_or_ein = ssn_or_ein, four_digit_ssn = four_digit_ssn, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, case_discharged_start_date = case_discharged_start_date, case_discharged_end_date = case_discharged_end_date, case_dismissed_start_date = case_dismissed_start_date, case_dismissed_end_date = case_dismissed_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + @staticmethod + def bankruptcy_courts_pacer_case_locator_party_search_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + ssn_or_ein: Annotated[Optional[Annotated[str, Field(strict=True, max_length=9)]], Field(description="The Social Security number or the federal Employer Identification Number of the target party. Either number can be entered with or without dashes.")] = None, + four_digit_ssn: Annotated[Optional[Annotated[str, Field(strict=True, max_length=4)]], Field(description="The last four digits of the Social Security number of the target party. Note: When specified, a last name/entity name must also be specified.")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_discharged_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_discharged_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLParty]: - Search for the specified party in PACER bankruptcy filings. + """PACER Case Locator Search API for All Courts. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Search for the specified party in PACER bankruptcy filings. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param ssn_or_ein: The Social Security number or the federal Employer Identification Number of the target party. Either number can be entered with or without dashes. + :type ssn_or_ein: str + :param four_digit_ssn: The last four digits of the Social Security number of the target party. Note: When specified, a last name/entity name must also be specified. + :type four_digit_ssn: str + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param case_discharged_start_date: The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_start_date: datetime + :param case_discharged_end_date: The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_end_date: datetime + :param case_dismissed_start_date: The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_dismissed_start_date: datetime + :param case_dismissed_end_date: The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_dismissed_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERApi(api_client).bankruptcy_courts_pacer_case_locator_party_search( - pacer_user_id, - pacer_client_code, - **kwargs - ) + return PACERApi(api_client).bankruptcy_courts_pacer_case_locator_party_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, ssn_or_ein = ssn_or_ein, four_digit_ssn = four_digit_ssn, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, case_discharged_start_date = case_discharged_start_date, case_discharged_end_date = case_discharged_end_date, case_dismissed_start_date = case_dismissed_start_date, case_dismissed_end_date = case_dismissed_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def bankruptcy_courts_pacer_case_locator_party_search_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + ssn_or_ein: Annotated[Optional[Annotated[str, Field(strict=True, max_length=9)]], Field(description="The Social Security number or the federal Employer Identification Number of the target party. Either number can be entered with or without dashes.")] = None, + four_digit_ssn: Annotated[Optional[Annotated[str, Field(strict=True, max_length=4)]], Field(description="The last four digits of the Social Security number of the target party. Note: When specified, a last name/entity name must also be specified.")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_discharged_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_discharged_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type.")] = None, + case_dismissed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """PACER Case Locator Search API for All Courts. + + Search for the specified party in PACER bankruptcy filings. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param ssn_or_ein: The Social Security number or the federal Employer Identification Number of the target party. Either number can be entered with or without dashes. + :type ssn_or_ein: str + :param four_digit_ssn: The last four digits of the Social Security number of the target party. Note: When specified, a last name/entity name must also be specified. + :type four_digit_ssn: str + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param case_discharged_start_date: The date on which or after which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_start_date: datetime + :param case_discharged_end_date: The date on which or before which the target case was marked as discharged within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_discharged_end_date: datetime + :param case_dismissed_start_date: The date on which or after which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). Note: This parameter is applicable since we only perform this search for Bankruptcy Court type. + :type case_dismissed_start_date: datetime + :param case_dismissed_end_date: The date on which or before which the target case was marked as dismissed within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_dismissed_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).bankruptcy_courts_pacer_case_locator_party_search_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, ssn_or_ein = ssn_or_ein, four_digit_ssn = four_digit_ssn, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, case_discharged_start_date = case_discharged_start_date, case_discharged_end_date = case_discharged_end_date, case_dismissed_start_date = case_dismissed_start_date, case_dismissed_end_date = case_dismissed_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def civil_courts_pacer_case_locator_case_search( - pacer_user_id, - pacer_client_code, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case.")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + nature_of_suits_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 110 (Insurance) and 140 (Negotiable Instrument), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=110&natureOfSuitsArray=140")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PCLCase]: + + """PACER Case Locator Search API for All Courts. + + Search for civil cases filed in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param nature_of_suits_array: The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 110 (Insurance) and 140 (Negotiable Instrument), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=110&natureOfSuitsArray=140 + :type nature_of_suits_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).civil_courts_pacer_case_locator_case_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, nature_of_suits_array = nature_of_suits_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def civil_courts_pacer_case_locator_case_search_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case.")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + nature_of_suits_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 110 (Insurance) and 140 (Negotiable Instrument), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=110&natureOfSuitsArray=140")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLCase]: + + """PACER Case Locator Search API for All Courts. + + Search for civil cases filed in PACER. - """PACER Case Locator Search API for All Courts. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param nature_of_suits_array: The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 110 (Insurance) and 140 (Negotiable Instrument), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=110&natureOfSuitsArray=140 + :type nature_of_suits_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PACERApi(api_client).civil_courts_pacer_case_locator_case_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, nature_of_suits_array = nature_of_suits_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def civil_courts_pacer_case_locator_case_search_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case.")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + nature_of_suits_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 110 (Insurance) and 140 (Negotiable Instrument), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=110&natureOfSuitsArray=140")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - Search for civil cases filed in PACER. + """PACER Case Locator Search API for All Courts. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Search for civil cases filed in PACER. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param nature_of_suits_array: The PACER-assigned nature of suit classification of the target case. Please refer to PCL Nature of Suits for valid nature-of-suit classifications for cases. Scenario: When mulitple nature of suits needs to be requested. Imagine for a given case number 12-1234 I would like to search with the nature of suit 110 (Insurance) and 140 (Negotiable Instrument), My query in the request will look like the example mentioned below. Example: natureOfSuitsArray=110&natureOfSuitsArray=140 + :type nature_of_suits_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERApi(api_client).civil_courts_pacer_case_locator_case_search( - pacer_user_id, - pacer_client_code, - **kwargs - ) + response = PACERApi(api_client).civil_courts_pacer_case_locator_case_search_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, nature_of_suits_array = nature_of_suits_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def civil_courts_pacer_case_locator_party_search( - pacer_user_id, - pacer_client_code, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The name suffix (e.g., III, MD).")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PCLParty]: + + """PACER Case Locator Search API for All Courts. + + Search for the specified party in civil cases filed in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The name suffix (e.g., III, MD). + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).civil_courts_pacer_case_locator_party_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def civil_courts_pacer_case_locator_party_search_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The name suffix (e.g., III, MD).")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLParty]: + + """PACER Case Locator Search API for All Courts. + + Search for the specified party in civil cases filed in PACER. - """PACER Case Locator Search API for All Courts. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The name suffix (e.g., III, MD). + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PACERApi(api_client).civil_courts_pacer_case_locator_party_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def civil_courts_pacer_case_locator_party_search_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The name suffix (e.g., III, MD).")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - Search for the specified party in civil cases filed in PACER. + """PACER Case Locator Search API for All Courts. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Search for the specified party in civil cases filed in PACER. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The name suffix (e.g., III, MD). + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERApi(api_client).civil_courts_pacer_case_locator_party_search( - pacer_user_id, - pacer_client_code, - **kwargs - ) + response = PACERApi(api_client).civil_courts_pacer_case_locator_party_search_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def criminal_courts_pacer_case_locator_case_search( - pacer_user_id, - pacer_client_code, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PCLCase]: - """PACER Case Locator Search API for All Courts. + """PACER Case Locator Search API for All Courts. + Search for criminal cases in PACER. - Search for criminal cases in PACER. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).criminal_courts_pacer_case_locator_case_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def criminal_courts_pacer_case_locator_case_search_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLCase]: + + """PACER Case Locator Search API for All Courts. + + Search for criminal cases in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PACERApi(api_client).criminal_courts_pacer_case_locator_case_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def criminal_courts_pacer_case_locator_case_search_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """PACER Case Locator Search API for All Courts. + + Search for criminal cases in PACER. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERApi(api_client).criminal_courts_pacer_case_locator_case_search( - pacer_user_id, - pacer_client_code, - **kwargs - ) + response = PACERApi(api_client).criminal_courts_pacer_case_locator_case_search_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def criminal_courts_pacer_case_locator_party_search( - pacer_user_id, - pacer_client_code, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PCLParty]: + + """PACER Case Locator Search API for All Courts. + + Search for the specified party in PACER criminal cases. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).criminal_courts_pacer_case_locator_party_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def criminal_courts_pacer_case_locator_party_search_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLParty]: + + """PACER Case Locator Search API for All Courts. + + Search for the specified party in PACER criminal cases. - """PACER Case Locator Search API for All Courts. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PACERApi(api_client).criminal_courts_pacer_case_locator_party_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def criminal_courts_pacer_case_locator_party_search_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - Search for the specified party in PACER criminal cases. + """PACER Case Locator Search API for All Courts. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Search for the specified party in PACER criminal cases. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERApi(api_client).criminal_courts_pacer_case_locator_party_search( - pacer_user_id, - pacer_client_code, - **kwargs - ) + response = PACERApi(api_client).criminal_courts_pacer_case_locator_party_search_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def import_pacer_case_by_court_using_case_number( - pacer_user_id, - pacer_client_code, - case_number, - court_id, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The PACER username of the PACER account under which the case should be imported.")], + case_number: Annotated[str, Field(min_length=3, strict=True, max_length=50, description="The case number of the case to be imported.")], + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the court from which the case is to be imported.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PACERImportCase]: + + """Find PACER Case for a requested Case Number and Court. + + Import the specified case from PACER. Workflow: 1.This API will return the Find Case results from the court site in a form of array of UniCourt Case Objects. These case objects will consists only Meta information of the case if not already present in the UniCourt Database. 2.To get the full updated case information one will have to request the caseUpdate API by passing the caseId. Note: 1.Charges for Find Case in District, Bankruptcy and National Courts is free. Find case for Appeal Courts will be charged at minimum rate of $0.1. The fee charged by the court for find case can be found in the response of this API in the field courtFee. 2.The results of the search has less Meta information in case objects compared to the Meta information of cases found using the PCL search APIs. + + :param pacer_user_id: The PACER username of the PACER account under which the case should be imported. (required) + :type pacer_user_id: str + :param case_number: The case number of the case to be imported. (required) + :type case_number: str + :param court_id: The courtId value of the court from which the case is to be imported. (required) + :type court_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).import_pacer_case_by_court_using_case_number_with_http_info(pacer_user_id = pacer_user_id, case_number = case_number, court_id = court_id, pacer_client_code = pacer_client_code, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def import_pacer_case_by_court_using_case_number_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The PACER username of the PACER account under which the case should be imported.")], + case_number: Annotated[str, Field(min_length=3, strict=True, max_length=50, description="The case number of the case to be imported.")], + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the court from which the case is to be imported.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PACERImportCase]: - """Find PACER Case for a requested Case Number and Court. + """Find PACER Case for a requested Case Number and Court. + Import the specified case from PACER. Workflow: 1.This API will return the Find Case results from the court site in a form of array of UniCourt Case Objects. These case objects will consists only Meta information of the case if not already present in the UniCourt Database. 2.To get the full updated case information one will have to request the caseUpdate API by passing the caseId. Note: 1.Charges for Find Case in District, Bankruptcy and National Courts is free. Find case for Appeal Courts will be charged at minimum rate of $0.1. The fee charged by the court for find case can be found in the response of this API in the field courtFee. 2.The results of the search has less Meta information in case objects compared to the Meta information of cases found using the PCL search APIs. - Import the specified case from PACER. Workflow: 1.This API will return the Find Case results from the court site in a form of array of UniCourt Case Objects. These case objects will consists only Meta information of the case if not already present in the UniCourt Database. 2.To get the full updated case information one will have to request the caseUpdate API by passing the caseId. Note: 1.Charges for Find Case in District, Bankruptcy and National Courts is free. Find case for Appeal Courts will be charged at minimum rate of $0.1. The fee charged by the court for find case can be found in the response of this API in the field courtFee. 2.The results of the search has less Meta information in case objects compared to the Meta information of cases found using the PCL search APIs. + :param pacer_user_id: The PACER username of the PACER account under which the case should be imported. (required) + :type pacer_user_id: str + :param case_number: The case number of the case to be imported. (required) + :type case_number: str + :param court_id: The courtId value of the court from which the case is to be imported. (required) + :type court_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PACERApi(api_client).import_pacer_case_by_court_using_case_number_with_http_info(pacer_user_id = pacer_user_id, case_number = case_number, court_id = court_id, pacer_client_code = pacer_client_code, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def import_pacer_case_by_court_using_case_number_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The PACER username of the PACER account under which the case should be imported.")], + case_number: Annotated[str, Field(min_length=3, strict=True, max_length=50, description="The case number of the case to be imported.")], + court_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The courtId value of the court from which the case is to be imported.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Find PACER Case for a requested Case Number and Court. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Import the specified case from PACER. Workflow: 1.This API will return the Find Case results from the court site in a form of array of UniCourt Case Objects. These case objects will consists only Meta information of the case if not already present in the UniCourt Database. 2.To get the full updated case information one will have to request the caseUpdate API by passing the caseId. Note: 1.Charges for Find Case in District, Bankruptcy and National Courts is free. Find case for Appeal Courts will be charged at minimum rate of $0.1. The fee charged by the court for find case can be found in the response of this API in the field courtFee. 2.The results of the search has less Meta information in case objects compared to the Meta information of cases found using the PCL search APIs. + :param pacer_user_id: The PACER username of the PACER account under which the case should be imported. (required) + :type pacer_user_id: str + :param case_number: The case number of the case to be imported. (required) + :type case_number: str + :param court_id: The courtId value of the court from which the case is to be imported. (required) + :type court_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERApi(api_client).import_pacer_case_by_court_using_case_number( - pacer_user_id, - pacer_client_code, - case_number, - court_id, - **kwargs - ) + response = PACERApi(api_client).import_pacer_case_by_court_using_case_number_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, case_number = case_number, court_id = court_id, pacer_client_code = pacer_client_code, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def multi_district_courts_pacer_case_locator_case_search( - pacer_user_id, - pacer_client_code, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + jpml_number: Annotated[Optional[StrictInt], Field(description="Master JPML Case Number.")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PCLCase]: - """PACER Case Locator Search API for All Courts. + """PACER Case Locator Search API for All Courts. + Search for multidistrict litigation in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param jpml_number: Master JPML Case Number. + :type jpml_number: int + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).multi_district_courts_pacer_case_locator_case_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, jpml_number = jpml_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def multi_district_courts_pacer_case_locator_case_search_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + jpml_number: Annotated[Optional[StrictInt], Field(description="Master JPML Case Number.")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLCase]: - Search for multidistrict litigation in PACER. + """PACER Case Locator Search API for All Courts. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Search for multidistrict litigation in PACER. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param jpml_number: Master JPML Case Number. + :type jpml_number: int + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERApi(api_client).multi_district_courts_pacer_case_locator_case_search( - pacer_user_id, - pacer_client_code, - **kwargs - ) + return PACERApi(api_client).multi_district_courts_pacer_case_locator_case_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, jpml_number = jpml_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def multi_district_courts_pacer_case_locator_case_search_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + jpml_number: Annotated[Optional[StrictInt], Field(description="Master JPML Case Number.")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """PACER Case Locator Search API for All Courts. + + Search for multidistrict litigation in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param jpml_number: Master JPML Case Number. + :type jpml_number: int + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).multi_district_courts_pacer_case_locator_case_search_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, jpml_number = jpml_number, pacer_case_id = pacer_case_id, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def multi_district_courts_pacer_case_locator_party_search( - pacer_user_id, - pacer_client_code, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + jpml_number: Annotated[Optional[StrictInt], Field(description="Master JPML Case Number.")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PCLParty]: + + """PACER Case Locator Search API for All Courts. - """PACER Case Locator Search API for All Courts. + Search for the specified party in multidistrict litigation in PACER. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param jpml_number: Master JPML Case Number. + :type jpml_number: int + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERApi(api_client).multi_district_courts_pacer_case_locator_party_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, jpml_number = jpml_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def multi_district_courts_pacer_case_locator_party_search_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + jpml_number: Annotated[Optional[StrictInt], Field(description="Master JPML Case Number.")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PCLParty]: + + """PACER Case Locator Search API for All Courts. + + Search for the specified party in multidistrict litigation in PACER. + + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param jpml_number: Master JPML Case Number. + :type jpml_number: int + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PACERApi(api_client).multi_district_courts_pacer_case_locator_party_search_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, jpml_number = jpml_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def multi_district_courts_pacer_case_locator_party_search_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=20, description="The username of the PACER account under which the search is to be performed.")], + pacer_client_code: Annotated[Optional[Annotated[str, Field(min_length=0, strict=True, max_length=32)]], Field(description="This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/)")] = None, + case_number: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=50)]], Field(description="The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit).")] = None, + jpml_number: Annotated[Optional[StrictInt], Field(description="Master JPML Case Number.")] = None, + pacer_case_id: Annotated[Optional[StrictInt], Field(description="The PACER-assigned identifier of the target case.")] = None, + last_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The last name (for an individual) or the entity name (for a business entity) of the target party.")] = None, + first_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The first name of the target party.")] = None, + middle_name: Annotated[Optional[Annotated[str, Field(strict=True, max_length=40)]], Field(description="The middle name of the target party.")] = None, + generation: Annotated[Optional[Annotated[str, Field(strict=True, max_length=5)]], Field(description="The suffix (e.g., Jr., III) of the target party's name.")] = None, + party_type: Annotated[Optional[Annotated[str, Field(strict=True, max_length=50)]], Field(description="The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + party_exact_name_match: Annotated[Optional[StrictBool], Field(description="Specify whether the search string must match the name of the target party exactly.")] = None, + party_role_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=50)]]]], Field(description="The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court.")] = None, + case_title: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc.")] = None, + case_office: Annotated[Optional[Annotated[str, Field(strict=True, max_length=1)]], Field(description="The divisional office in which the case was filed.")] = None, + case_sequence_number: Annotated[Optional[Annotated[int, Field(le=99999, strict=True, ge=0)]], Field(description="The PACER-assigned sequence number of the target case. Ex 12345")] = None, + case_year: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="The two- or four-digit year in which the target case was filed.")] = None, + case_type_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr")] = None, + court_region_id_array: Annotated[Optional[List[Optional[Annotated[str, Field(strict=True, max_length=255)]]]], Field(description="The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae")] = None, + case_year_from: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or later")] = None, + case_year_to: Annotated[Optional[Annotated[int, Field(le=2100, strict=True, ge=0)]], Field(description="Limit the results of the search to those cases from the year specified or earlier")] = None, + case_filed_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_filed_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_start_date: Annotated[Optional[datetime], Field(description="The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + case_terminated_end_date: Annotated[Optional[datetime], Field(description="The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00).")] = None, + sort_parameter_query: Annotated[Optional[Annotated[str, Field(min_length=5, strict=True, max_length=100)]], Field(description="How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC")] = None, + case_status: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=100)]], Field(description="Whether the target case is marked as 'open' or 'closed' within PACER.")] = None, + page_number: Annotated[Optional[StrictInt], Field(description="The page number of the search results to be retrieved.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - Search for the specified party in multidistrict litigation in PACER. + """PACER Case Locator Search API for All Courts. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Search for the specified party in multidistrict litigation in PACER. + :param pacer_user_id: The username of the PACER account under which the search is to be performed. (required) + :type pacer_user_id: str + :param pacer_client_code: This is mandatory if your setting in PACER website is set to Yes for the flag `Require Client Code?` under `Set PACER Billing Preferences` page. The client code is a text field entered by users upon login that can be used to track usage by person, client matter number, or other meaningful entry up to 32 characters, comprising the following: Alphabetic characters (A-Z or a-z) Numeric digits (0-9) Period (.) Underscore (_) Hyphen (-) Slash (/) + :type pacer_client_code: str + :param case_number: The case number of the target case. You may use the following case-number formats: yy-nnnnn yy-tp-nnnnn yy tp nnnnn yytpnnnnn o:yy-nnnnn o:yy-tp-nnnnn o:yy tp nnnnn o:yytpnnnnn where: yy case year (may be 2 or 4 digits) nnnnn case number (up to 5 digits) tp case type (up to 2 characters) o office where the case was filed (1 digit). + :type case_number: str + :param jpml_number: Master JPML Case Number. + :type jpml_number: int + :param pacer_case_id: The PACER-assigned identifier of the target case. + :type pacer_case_id: int + :param last_name: The last name (for an individual) or the entity name (for a business entity) of the target party. + :type last_name: str + :param first_name: The first name of the target party. + :type first_name: str + :param middle_name: The middle name of the target party. + :type middle_name: str + :param generation: The suffix (e.g., Jr., III) of the target party's name. + :type generation: str + :param party_type: The court-assigned party type for a party involved in a case. Party type codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_type: str + :param party_exact_name_match: Specify whether the search string must match the name of the target party exactly. + :type party_exact_name_match: bool + :param party_role_array: The court-assigned role for a party to a case. Party role codes are created and assigned by individual courts, and as such, their meanings can vary from court to court. + :type party_role_array: List[Optional[str]] + :param case_title: The title of the target case. Examples: A search for case title john doe v will result in all cases with the case title John Doe v. A search for case title Acme, Inc. will result in all case titles starting with Acme, Inc. + :type case_title: str + :param case_office: The divisional office in which the case was filed. + :type case_office: str + :param case_sequence_number: The PACER-assigned sequence number of the target case. Ex 12345 + :type case_sequence_number: int + :param case_year: The two- or four-digit year in which the target case was filed. + :type case_year: int + :param case_type_array: The PACER-assigned case type of the target case. Please refer to PCL Case Types for valid case-type values. Scenario: When mulitple case types needs to be requested. Imagine for a given case number 12-1234 I would like to search only with the case type civil(cv) and criminal(cr), My query in the request will look like the example mentioned below. Example: caseTypeArray=cv&caseTypeArray=cr + :type case_type_array: List[Optional[str]] + :param court_region_id_array: The PACER-assigned court region in which the target case was filed. Please refer to PCL Court Regions for valid court-region values. Scenario: When mulitple court region ids needs to be requested. Imagine for a given case number 12-1234 I would like to search in the court regions California Central (cac) and California Eastern (cae), My query in the request will look like the example mentioned below. Example: courtRegionIdArray=cac&courtRegionIdArray=cae + :type court_region_id_array: List[Optional[str]] + :param case_year_from: Limit the results of the search to those cases from the year specified or later + :type case_year_from: int + :param case_year_to: Limit the results of the search to those cases from the year specified or earlier + :type case_year_to: int + :param case_filed_start_date: The date on which or after which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_start_date: datetime + :param case_filed_end_date: The date on which or before which the target case was filed. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_filed_end_date: datetime + :param case_terminated_start_date: The date on which or after which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_start_date: datetime + :param case_terminated_end_date: The date on which or before which the target case was marked as terminated within PACER. The date format must be YYYY-MM-DDTHH:MM:SS+ZZ:zz, (e.g., 2017-12-20T12:54:24+00:00). + :type case_terminated_end_date: datetime + :param sort_parameter_query: How search results from PACER are to be sorted. Please refer to PCL Sort Parameters for valid sort-related settings. Scenario 1: When mulitple sort paramters needs to be requested. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of courtId and caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtId,ASC&caseId,ASC Scenario 2: When you want to sort the response using the case parameters in the party search. Imagine for a given case number 12-1234 I would like to sort the results in the Ascending order of caseOffice and descending order of caseId, My query in the request will look like the example mentioned below. Example: sortParameterQuery=courtCase.caseOffice,ASC&caseId,DESC + :type sort_parameter_query: str + :param case_status: Whether the target case is marked as 'open' or 'closed' within PACER. + :type case_status: str + :param page_number: The page number of the search results to be retrieved. + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERApi(api_client).multi_district_courts_pacer_case_locator_party_search( - pacer_user_id, - pacer_client_code, - **kwargs - ) + response = PACERApi(api_client).multi_district_courts_pacer_case_locator_party_search_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, pacer_client_code = pacer_client_code, case_number = case_number, jpml_number = jpml_number, pacer_case_id = pacer_case_id, last_name = last_name, first_name = first_name, middle_name = middle_name, generation = generation, party_type = party_type, party_exact_name_match = party_exact_name_match, party_role_array = party_role_array, case_title = case_title, case_office = case_office, case_sequence_number = case_sequence_number, case_year = case_year, case_type_array = case_type_array, court_region_id_array = court_region_id_array, case_year_from = case_year_from, case_year_to = case_year_to, case_filed_start_date = case_filed_start_date, case_filed_end_date = case_filed_end_date, case_terminated_start_date = case_terminated_start_date, case_terminated_end_date = case_terminated_end_date, sort_parameter_query = sort_parameter_query, case_status = case_status, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/PACERCredential.py b/unicourt/sdk/PACERCredential.py index db81c89..d64b432 100644 --- a/unicourt/sdk/PACERCredential.py +++ b/unicourt/sdk/PACERCredential.py @@ -1,83 +1,590 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated +from unicourt.model.pacer_credential import PacerCredential +from unicourt.model.pacer_credential_list_response import PacerCredentialListResponse +from unicourt.model.pacer_credential_request import PacerCredentialRequest +from unicourt.model.success import Success +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.pacer_credential_api import PACERCredentialApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class PACERCredential: @staticmethod def add_pacer_credential( - **kwargs - ): + pacer_credential_request: Optional[PacerCredentialRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[Success]: - """Add Pacer Credential. + """Add Pacer Credential. + Register PACER credentials with UniCourt. - Register PACER credentials with UniCourt. + :param pacer_credential_request: + :type pacer_credential_request: PacerCredentialRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERCredentialApi(api_client).add_pacer_credential_with_http_info(pacer_credential_request = pacer_credential_request, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def add_pacer_credential_with_http_info( + pacer_credential_request: Optional[PacerCredentialRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Success]: + + """Add Pacer Credential. + + Register PACER credentials with UniCourt. + + :param pacer_credential_request: + :type pacer_credential_request: PacerCredentialRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PACERCredentialApi(api_client).add_pacer_credential_with_http_info(pacer_credential_request = pacer_credential_request, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def add_pacer_credential_without_preload_content( + pacer_credential_request: Optional[PacerCredentialRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Add Pacer Credential. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Register PACER credentials with UniCourt. + :param pacer_credential_request: + :type pacer_credential_request: PacerCredentialRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERCredentialApi(api_client).add_pacer_credential( - **kwargs - ) + response = PACERCredentialApi(api_client).add_pacer_credential_without_preload_content_with_http_info(pacer_credential_request = pacer_credential_request, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_pacer_credential( - **kwargs - ): + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the PACER credentials to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PacerCredentialListResponse]: - """Get Pacer Credential List. + """Get Pacer Credential List. + List registered PACER credentials. + + :param page_number: The page number of the PACER credentials to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERCredentialApi(api_client).get_pacer_credential_with_http_info(page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def get_pacer_credential_with_http_info( + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the PACER credentials to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PacerCredentialListResponse]: + + """Get Pacer Credential List. + + List registered PACER credentials. + + :param page_number: The page number of the PACER credentials to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PACERCredentialApi(api_client).get_pacer_credential_with_http_info(page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def get_pacer_credential_without_preload_content( + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the PACER credentials to be retrieved.
- Minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - List registered PACER credentials. + """Get Pacer Credential List. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + List registered PACER credentials. + :param page_number: The page number of the PACER credentials to be retrieved.
- Minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERCredentialApi(api_client).get_pacer_credential( - **kwargs - ) + response = PACERCredentialApi(api_client).get_pacer_credential_without_preload_content_with_http_info(page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_pacer_credential_by_id( - pacer_user_id, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40, description="The PACER username for which PACER credentials are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[PacerCredential]: - """Get Pacer Credential for a requested pacer User Id. + """Get Pacer Credential for a requested pacer User Id. + Retrieve the PACER credentials for the specified PACER username. - Retrieve the PACER credentials for the specified PACER username. + :param pacer_user_id: The PACER username for which PACER credentials are to be retrieved. (required) + :type pacer_user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERCredentialApi(api_client).get_pacer_credential_by_id_with_http_info(pacer_user_id = pacer_user_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def get_pacer_credential_by_id_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40, description="The PACER username for which PACER credentials are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PacerCredential]: + + """Get Pacer Credential for a requested pacer User Id. + + Retrieve the PACER credentials for the specified PACER username. + + :param pacer_user_id: The PACER username for which PACER credentials are to be retrieved. (required) + :type pacer_user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PACERCredentialApi(api_client).get_pacer_credential_by_id_with_http_info(pacer_user_id = pacer_user_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def get_pacer_credential_by_id_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40, description="The PACER username for which PACER credentials are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Get Pacer Credential for a requested pacer User Id. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Retrieve the PACER credentials for the specified PACER username. + :param pacer_user_id: The PACER username for which PACER credentials are to be retrieved. (required) + :type pacer_user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERCredentialApi(api_client).get_pacer_credential_by_id( - pacer_user_id, - **kwargs - ) + response = PACERCredentialApi(api_client).get_pacer_credential_by_id_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def remove_pacer_credential_by_id( - pacer_user_id, - **kwargs - ): + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40, description="The PACER username for which PACER credentials are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[Success]: - """Remove Pacer credential for a specific Pacer User Id. + """Remove Pacer credential for a specific Pacer User Id. + De-register the PACER credentials for the specified PACER username. + + :param pacer_user_id: The PACER username for which PACER credentials are to be retrieved. (required) + :type pacer_user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PACERCredentialApi(api_client).remove_pacer_credential_by_id_with_http_info(pacer_user_id = pacer_user_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def remove_pacer_credential_by_id_with_http_info( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40, description="The PACER username for which PACER credentials are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Success]: + + """Remove Pacer credential for a specific Pacer User Id. + + De-register the PACER credentials for the specified PACER username. + + :param pacer_user_id: The PACER username for which PACER credentials are to be retrieved. (required) + :type pacer_user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PACERCredentialApi(api_client).remove_pacer_credential_by_id_with_http_info(pacer_user_id = pacer_user_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def remove_pacer_credential_by_id_without_preload_content( + pacer_user_id: Annotated[str, Field(min_length=6, strict=True, max_length=40, description="The PACER username for which PACER credentials are to be retrieved.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - De-register the PACER credentials for the specified PACER username. + """Remove Pacer credential for a specific Pacer User Id. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + De-register the PACER credentials for the specified PACER username. + :param pacer_user_id: The PACER username for which PACER credentials are to be retrieved. (required) + :type pacer_user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PACERCredentialApi(api_client).remove_pacer_credential_by_id( - pacer_user_id, - **kwargs - ) + response = PACERCredentialApi(api_client).remove_pacer_credential_by_id_without_preload_content_with_http_info(pacer_user_id = pacer_user_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/PartyAnalytics.py b/unicourt/sdk/PartyAnalytics.py index 4cc582c..aae5536 100644 --- a/unicourt/sdk/PartyAnalytics.py +++ b/unicourt/sdk/PartyAnalytics.py @@ -1,127 +1,949 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated +from unicourt.model.associated_norm_attorney_response import AssociatedNormAttorneyResponse +from unicourt.model.associated_norm_judge_response import AssociatedNormJudgeResponse +from unicourt.model.associated_norm_law_firm_response import AssociatedNormLawFirmResponse +from unicourt.model.norm_party import NormParty +from unicourt.model.norm_party_search_response import NormPartySearchResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.party_analytics_api import PartyAnalyticsApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class PartyAnalytics: @staticmethod def get_norm_attorneys_associated_with_norm_party( - norm_party_id, - **kwargs - ): - - """Attorneys that represented the Party. - - - Search for attorneys who have represented a given party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyID value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AssociatedNormAttorneyResponse]: + + """Attorneys that represented the Party. + + Search for attorneys who have represented a given party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_party_id: The normPartyID value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PartyAnalyticsApi(api_client).get_norm_attorneys_associated_with_norm_party_with_http_info(norm_party_id = norm_party_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_attorneys_associated_with_norm_party_with_http_info( + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyID value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormAttorneyResponse]: + + """Attorneys that represented the Party. + + Search for attorneys who have represented a given party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_party_id: The normPartyID value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PartyAnalyticsApi(api_client).get_norm_attorneys_associated_with_norm_party_with_http_info(norm_party_id = norm_party_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_attorneys_associated_with_norm_party_without_preload_content( + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyID value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired attorneys.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Attorneys that represented the Party. + + Search for attorneys who have represented a given party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all attorneys associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_party_id: The normPartyID value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired attorneys. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PartyAnalyticsApi(api_client).get_norm_attorneys_associated_with_norm_party( - norm_party_id, - **kwargs - ) + response = PartyAnalyticsApi(api_client).get_norm_attorneys_associated_with_norm_party_without_preload_content_with_http_info(norm_party_id = norm_party_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_norm_judges_associated_with_norm_party( - norm_party_id, - **kwargs - ): - - """Judges Faced By the Party. - - - Search for judges before whom a party has appeared using a keyword expression.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AssociatedNormJudgeResponse]: + + """Judges Faced By the Party. + + Search for judges before whom a party has appeared using a keyword expression.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PartyAnalyticsApi(api_client).get_norm_judges_associated_with_norm_party_with_http_info(norm_party_id = norm_party_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_judges_associated_with_norm_party_with_http_info( + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormJudgeResponse]: + + """Judges Faced By the Party. + + Search for judges before whom a party has appeared using a keyword expression.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PartyAnalyticsApi(api_client).get_norm_judges_associated_with_norm_party_with_http_info(norm_party_id = norm_party_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_judges_associated_with_norm_party_without_preload_content( + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Judges Faced By the Party. + + Search for judges before whom a party has appeared using a keyword expression.

## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all judges associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00]

+ + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired judges. Keywords should be constructed according to the guidelines given above. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PartyAnalyticsApi(api_client).get_norm_judges_associated_with_norm_party( - norm_party_id, - **kwargs - ) + response = PartyAnalyticsApi(api_client).get_norm_judges_associated_with_norm_party_without_preload_content_with_http_info(norm_party_id = norm_party_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_norm_law_firms_associated_with_norm_party( - norm_party_id, - **kwargs - ): - - """Law Firms that represented the Party. - - - Search for law firms that have represented the specified party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all lawfirms associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired law firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[AssociatedNormLawFirmResponse]: + + """Law Firms that represented the Party. + + Search for law firms that have represented the specified party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all lawfirms associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PartyAnalyticsApi(api_client).get_norm_law_firms_associated_with_norm_party_with_http_info(norm_party_id = norm_party_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_law_firms_associated_with_norm_party_with_http_info( + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired law firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssociatedNormLawFirmResponse]: + + """Law Firms that represented the Party. + + Search for law firms that have represented the specified party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all lawfirms associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PartyAnalyticsApi(api_client).get_norm_law_firms_associated_with_norm_party_with_http_info(norm_party_id = norm_party_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_law_firms_associated_with_norm_party_without_preload_content( + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=2048)]], Field(description="The keyword expression targeting the desired law firms.")] = None, + page_number: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="The page number of the desired page of results. - minimum: 1 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Law Firms that represented the Party. + + Search for law firms that have represented the specified party using a keyword expression. ## Terms and Connectors | Connector | Schema | Description | Example | | ------| ------| ------|------| | **AND** ||Find analytics containing all connected terms. The word AND does not have to be capitalized.|**courtId:\"CORTV4vCEaKrhystBz\" AND courtLocationId:\"COLO6b82CkRqS846hx\"**| | **IN()** || Allows you to specify multiple values, for a limit of up to 10.| **courtId IN (\"CORTV4vCEaKrhystBz\",\"CORTYsomR6GiiiPovp\")**| | **courtId** | Multiple Ids Allowed |Find Analytics for a particular Court Object. | **courtId:\"CORTV4vCEaKrhystBz\"** | | **courtSystemId** | Multiple Ids Allowed |Find Analytics for a particular Court System Object. | **courtSystemId:\"COSYACHBdMewtaG5DY\"** | | **courtTypeId** | Multiple Ids Allowed |Find Analytics for a particular Court Type Object. | **courtTypeId:\"COTPm8jjc2PAydpFhq\"** | | **courtLocationId** | Multiple Ids Allowed |Find Analytics for a particular Court Location Object. | **courtLocationId:\"COLO6b82CkRqS846hx\"** | | **caseTypeId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Object. | **caseTypeId:\"CTYPGkaW3aGJyKGyfn\"** | | **caseTypeGroupId** | Multiple Ids Allowed |Find Analytics for a particular Case Type Group Object. | **caseTypeGroupId:\"CTYGBDwLfbbNBPBn5e\"** | | **areaOfLawId** | Multiple Ids Allowed |Find Analytics for a particular Area Of Law Object. | **areaOfLawId:\"AOFL2UxEWfVmTPMyqf\"** | | **caseClassId** | Multiple Ids Allowed |Find Analytics for a particular Case Class Category Object. | **caseClassId:\"CSCLNjbKTN7Yfo2wdb\"** | | **partyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Object. | **partyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **partyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Party Type Group Object. | **partyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **attorneyPartyRoleId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Object. | **attorneyPartyRoleId:\"PTYRiP8nMgPxBsPc5i\"** | | **attorneyPartyRoleGroupId** | Multiple Ids Allowed |Find Analytics for a particular Attorney Party Type Group Object. | **attorneyPartyRoleGroupId:\"PTYGBnjxbx6tKNfVEP\"** | | **caseFiledDate** | Single Allowed |Find Analytics within a particular date range. | **caseFiledDate:[2018-05-08T00:00:00+00:00TO2019-05-08T00:00:00+00:00]** | | **JurisdictionGeo** | Multiple filters Allowed |Find Analytics within a particular Jurisdiction Geo. | **(JurisdictionGeo:(state:\"California\"))** | | **confidenceScore** | Single Allowed |Find Analytics for a given ConfidenceScore | **confidenceScore:[0.3 TO \\*]** | | **bestMatch** | Single Allowed |True if the normEntity has the highest Confidence Score of all possible normEntities | **bestMatch:true** |
## Example Query Query to get all lawfirms associated with Party with norm id NORGrPmQyLdx9NGHcT of all cases with case type id CTYPGkaW3aGJyKGyfn and case filed date between Jan 1st, 2017 to Nov 30th,2021
q=caseTypeId:\"CTYPGkaW3aGJyKGyfn\" AND caseFiledDate:[2017-01-01T00:00:00+00:00TO2021-11-30T00:00:00+00:00] + + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param q: The keyword expression targeting the desired law firms. + :type q: str + :param page_number: The page number of the desired page of results. - minimum: 1 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PartyAnalyticsApi(api_client).get_norm_law_firms_associated_with_norm_party( - norm_party_id, - **kwargs - ) + response = PartyAnalyticsApi(api_client).get_norm_law_firms_associated_with_norm_party_without_preload_content_with_http_info(norm_party_id = norm_party_id, q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_norm_party_by_id( - norm_party_id, - **kwargs - ): - - """Norm Party Details. - - - Retrieve the specified party. + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[NormParty]: + + """Norm Party Details. + + Retrieve the specified party. + + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PartyAnalyticsApi(api_client).get_norm_party_by_id_with_http_info(norm_party_id = norm_party_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_norm_party_by_id_with_http_info( + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormParty]: + + """Norm Party Details. + + Retrieve the specified party. + + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PartyAnalyticsApi(api_client).get_norm_party_by_id_with_http_info(norm_party_id = norm_party_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def get_norm_party_by_id_without_preload_content( + norm_party_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartyId value of the desired party. - minimum: 18 - maximum: 18 ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Norm Party Details. + + Retrieve the specified party. + + :param norm_party_id: The normPartyId value of the desired party. - minimum: 18 - maximum: 18 (required) + :type norm_party_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PartyAnalyticsApi(api_client).get_norm_party_by_id( - norm_party_id, - **kwargs - ) + response = PartyAnalyticsApi(api_client).get_norm_party_by_id_without_preload_content_with_http_info(norm_party_id = norm_party_id, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def search_normalized_parties( - **kwargs - ): - - """Party search. - - - ### Search for a party using a keyword expression. + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[NormPartySearchResponse]: + + """Party search. + + ### Search for a party using a keyword expression. + + :param q: The keyword expression targeting the desired party. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PartyAnalyticsApi(api_client).search_normalized_parties_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def search_normalized_parties_with_http_info( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormPartySearchResponse]: + + """Party search. + + ### Search for a party using a keyword expression. + + :param q: The keyword expression targeting the desired party. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PartyAnalyticsApi(api_client).search_normalized_parties_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def search_normalized_parties_without_preload_content( + q: Annotated[Optional[Annotated[str, Field(min_length=3, strict=True, max_length=2000)]], Field(description="The keyword expression targeting the desired party. ")] = None, + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Party search. + + ### Search for a party using a keyword expression. + + :param q: The keyword expression targeting the desired party. + :type q: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PartyAnalyticsApi(api_client).search_normalized_parties( - **kwargs - ) + response = PartyAnalyticsApi(api_client).search_normalized_parties_without_preload_content_with_http_info(q = q, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def search_normalized_parties_by_id( - norm_party_search_id, - **kwargs - ): - - """Norm party search results for a given normPartySearchId. - - - ### Retrieve a search for a party. + norm_party_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartySearchId value of the search to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[NormPartySearchResponse]: + + """Norm party search results for a given normPartySearchId. + + ### Retrieve a search for a party. + + :param norm_party_search_id: The normPartySearchId value of the search to be retrieved. (required) + :type norm_party_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = PartyAnalyticsApi(api_client).search_normalized_parties_by_id_with_http_info(norm_party_search_id = norm_party_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def search_normalized_parties_by_id_with_http_info( + norm_party_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartySearchId value of the search to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NormPartySearchResponse]: + + """Norm party search results for a given normPartySearchId. + + ### Retrieve a search for a party. + + :param norm_party_search_id: The normPartySearchId value of the search to be retrieved. (required) + :type norm_party_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return PartyAnalyticsApi(api_client).search_normalized_parties_by_id_with_http_info(norm_party_search_id = norm_party_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + @staticmethod + def search_normalized_parties_by_id_without_preload_content( + norm_party_search_id: Annotated[str, Field(min_length=18, strict=True, max_length=18, description="The normPartySearchId value of the search to be retrieved.")], + page_number: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Norm party search results for a given normPartySearchId. + + ### Retrieve a search for a party. + + :param norm_party_search_id: The normPartySearchId value of the search to be retrieved. (required) + :type norm_party_search_id: str + :param page_number: The page number of the desired page of results. - Minimum: 1 - Maximum: 1000 + :type page_number: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return PartyAnalyticsApi(api_client).search_normalized_parties_by_id( - norm_party_search_id, - **kwargs - ) + response = PartyAnalyticsApi(api_client).search_normalized_parties_by_id_without_preload_content_with_http_info(norm_party_search_id = norm_party_search_id, page_number = page_number, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/Usage.py b/unicourt/sdk/Usage.py index 8b9e27e..d016e4e 100644 --- a/unicourt/sdk/Usage.py +++ b/unicourt/sdk/Usage.py @@ -1,64 +1,437 @@ +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from datetime import date +from pydantic import Field +from typing_extensions import Annotated +from unicourt.model.billing_cycle_usage_response import BillingCycleUsageResponse +from unicourt.model.billing_cycles_response import BillingCyclesResponse +from unicourt.model.daily_usage_response import DailyUsageResponse +from unicourt.api_client import ApiClient, RequestSerialized +from unicourt.api_response import ApiResponse +from unicourt.rest import RESTResponseType from unicourt.api.usage_api import UsageApi +from unicourt.sdk_response import SdkResponse from unicourt import utils class Usage: @staticmethod def get_billing_cycles( - **kwargs - ): + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[BillingCyclesResponse]: - """Get all the previous 12 billing cycles. + """Get all the previous 12 billing cycles. + An endpoint to obtain information on the previous 12 billing cycles. - An endpoint to obtain information on the previous 12 billing cycles. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = UsageApi(api_client).get_billing_cycles_with_http_info(_request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def get_billing_cycles_with_http_info( + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BillingCyclesResponse]: + + """Get all the previous 12 billing cycles. + + An endpoint to obtain information on the previous 12 billing cycles. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return UsageApi(api_client).get_billing_cycles_with_http_info(_request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @staticmethod + def get_billing_cycles_without_preload_content( + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: + + """Get all the previous 12 billing cycles. + + An endpoint to obtain information on the previous 12 billing cycles. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return UsageApi(api_client).get_billing_cycles( - **kwargs - ) + response = UsageApi(api_client).get_billing_cycles_without_preload_content_with_http_info(_request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_billing_usage_by_billing_cycle( - billing_cycle, - **kwargs - ): + billing_cycle: Annotated[str, Field(min_length=22, strict=True, max_length=22, description="The date obtainable from the /billingCycles endpoint which is used as an identifier for the specific billing cycle you wish to obtain information on.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[BillingCycleUsageResponse]: + + """Specify the billing cycle to know the API usage. + + An endpoint to obtain information on API usage for a specific billing cycle. + + :param billing_cycle: The date obtainable from the /billingCycles endpoint which is used as an identifier for the specific billing cycle you wish to obtain information on. (required) + :type billing_cycle: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = UsageApi(api_client).get_billing_usage_by_billing_cycle_with_http_info(billing_cycle = billing_cycle, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def get_billing_usage_by_billing_cycle_with_http_info( + billing_cycle: Annotated[str, Field(min_length=22, strict=True, max_length=22, description="The date obtainable from the /billingCycles endpoint which is used as an identifier for the specific billing cycle you wish to obtain information on.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BillingCycleUsageResponse]: - """Specify the billing cycle to know the API usage. + """Specify the billing cycle to know the API usage. + An endpoint to obtain information on API usage for a specific billing cycle. - An endpoint to obtain information on API usage for a specific billing cycle. + :param billing_cycle: The date obtainable from the /billingCycles endpoint which is used as an identifier for the specific billing cycle you wish to obtain information on. (required) + :type billing_cycle: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return UsageApi(api_client).get_billing_usage_by_billing_cycle_with_http_info(billing_cycle = billing_cycle, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def get_billing_usage_by_billing_cycle_without_preload_content( + billing_cycle: Annotated[str, Field(min_length=22, strict=True, max_length=22, description="The date obtainable from the /billingCycles endpoint which is used as an identifier for the specific billing cycle you wish to obtain information on.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + """Specify the billing cycle to know the API usage. + An endpoint to obtain information on API usage for a specific billing cycle. + + :param billing_cycle: The date obtainable from the /billingCycles endpoint which is used as an identifier for the specific billing cycle you wish to obtain information on. (required) + :type billing_cycle: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return UsageApi(api_client).get_billing_usage_by_billing_cycle( - billing_cycle, - **kwargs - ) + response = UsageApi(api_client).get_billing_usage_by_billing_cycle_without_preload_content_with_http_info(billing_cycle = billing_cycle, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) @staticmethod def get_daily_usage_by_date( - date, - **kwargs - ): + date: Annotated[date, Field(description="The specific date for which you wish to obtain information on API usage.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[DailyUsageResponse]: + + """Get API usage for a requested Date. + + An endpoint to obtain information on API usage for a specific day. + + :param date: The specific date for which you wish to obtain information on API usage. (required) + :type date: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + response = UsageApi(api_client).get_daily_usage_by_date_with_http_info(date = date, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) + + @staticmethod + def get_daily_usage_by_date_with_http_info( + date: Annotated[date, Field(description="The specific date for which you wish to obtain information on API usage.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[DailyUsageResponse]: + + """Get API usage for a requested Date. - """Get API usage for a requested Date. + An endpoint to obtain information on API usage for a specific day. + :param date: The specific date for which you wish to obtain information on API usage. (required) + :type date: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ + with utils.api_client() as api_client: + return UsageApi(api_client).get_daily_usage_by_date_with_http_info(date = date, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + + @staticmethod + def get_daily_usage_by_date_without_preload_content( + date: Annotated[date, Field(description="The specific date for which you wish to obtain information on API usage.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SdkResponse[RESTResponseType]: - An endpoint to obtain information on API usage for a specific day. + """Get API usage for a requested Date. - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + An endpoint to obtain information on API usage for a specific day. + :param date: The specific date for which you wish to obtain information on API usage. (required) + :type date: date + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. """ with utils.api_client() as api_client: - return UsageApi(api_client).get_daily_usage_by_date( - date, - **kwargs - ) + response = UsageApi(api_client).get_daily_usage_by_date_without_preload_content_with_http_info(date = date, _request_timeout = _request_timeout, _request_auth = _request_auth, _content_type = _content_type, _headers = _headers, _host_index = _host_index) + return (response.data, response.status_code) diff --git a/unicourt/sdk/__init__.py b/unicourt/sdk/__init__.py index f6a28a2..b7b140d 100644 --- a/unicourt/sdk/__init__.py +++ b/unicourt/sdk/__init__.py @@ -1,3 +1,18 @@ -# do not import all apis into this module because that uses a lot of memory and stack frames - # if you need the ability to import all apis from one package, import them with - # from unicourt.sdk import AttorneyAnalytics \ No newline at end of file +from unicourt.sdk.PartyAnalytics import PartyAnalytics +from unicourt.sdk.JudgeAnalytics import JudgeAnalytics +from unicourt.sdk.CaseAnalytics import CaseAnalytics +from unicourt.sdk.CaseUpdate import CaseUpdate +from unicourt.sdk.CaseExport import CaseExport +from unicourt.sdk.CourtAvailability import CourtAvailability +from unicourt.sdk.PACER import PACER +from unicourt.sdk.CaseDocket import CaseDocket +from unicourt.sdk.PACERCredential import PACERCredential +from unicourt.sdk.Callback import Callback +from unicourt.sdk.CaseSearch import CaseSearch +from unicourt.sdk.Authentication import Authentication +from unicourt.sdk.AttorneyAnalytics import AttorneyAnalytics +from unicourt.sdk.CourtStandards import CourtStandards +from unicourt.sdk.CaseTracking import CaseTracking +from unicourt.sdk.CaseDocuments import CaseDocuments +from unicourt.sdk.Usage import Usage +from unicourt.sdk.LawFirmAnalytics import LawFirmAnalytics diff --git a/unicourt/sdk_response.py b/unicourt/sdk_response.py new file mode 100644 index 0000000..86e9f62 --- /dev/null +++ b/unicourt/sdk_response.py @@ -0,0 +1,18 @@ +"""SDK response object.""" + +from __future__ import annotations +from typing import Generic, TypeVar +from pydantic import Field, StrictInt, BaseModel + +T = TypeVar("T") + +class SdkResponse(BaseModel, Generic[T]): + """ + SDK response object + """ + + data: tuple[T, StrictInt] = Field(description="Deserialized data given the data type and HTTP status code") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/unicourt/utils.py b/unicourt/utils.py index 6545f0f..af3c83d 100644 --- a/unicourt/utils.py +++ b/unicourt/utils.py @@ -2,8 +2,6 @@ from collections import namedtuple # access client config through this function. - - def api_client(): if not unicourt.configuration: unicourt.configuration = unicourt.Configuration(